-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharArray.java
More file actions
24 lines (23 loc) · 861 Bytes
/
CharArray.java
File metadata and controls
24 lines (23 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class CharArray
{
public static void main(String[] args) {
// char name[]={'A','M','A','N'}; //CHARACTER ARRAY
// char ch='A';
// String namez=new String(name);
// String namez=new String(ch); //error
// System.out.println("the name is "+namez);
String fname="aMan";
// String lname=" Tiwari";
String namez="amaN";
// String fullname=fname+lname;
// System.out.println("the fullname is "+fullname);
// boolean check=(fname==lname);
// System.out.println(fname==lname);
// System.out.println("the value is "+check);
// System.out.println("the length is :"+fname.length());
System.out.println(fname.compareTo(namez));
//exact match gives zero (A == A)
// A > a 65-97 => -32
// a > A 97-65 => 32
}
}