Sunday, 1 February 2015

Java is Case Sensitive

Java is case sensitive so you can have two different variables in a program, one called xyz and another called XYZ. You can see what I mean in the example below:

andrew@UBUNTU:~/Java$ cat Case_Sensitive.java
class Case_Sensitive   
  {
  public static void main(String args[])
    {
    int xyz = 123;
    int XYZ = 234;
    System.out.println("xyz = " + xyz);
    System.out.println("XYZ = " + XYZ);
    }
  }
andrew@UBUNTU:~/Java$ javac Case_Sensitive.java
andrew@UBUNTU:~/Java$ java Case_Sensitive
xyz = 123
XYZ = 234
andrew@UBUNTU:~/Java$