Java-Variables

Variables A variable is an identifier that denotes a storage location in which a value is stored. A variable may take different values during the execution of a program. Since Java is case-sensitive, uppercase letters and lowercase letters are distinct in Java. Thus the variable name sum is not the same as the variable name … Read more…

Java-String Concatenation

String Concatenation To join two String objects to form a new, single string you use the + operator, just as you have been doing with the argument to the println() method in the program example thus far. Program Program Source class Javaapp { public static void main(String[] args) { System.out.println(“hajsof”+”java”+”tutorial”); } }

Java-Print and Println

Print and Println The print() method prints just the string, but does not move to a new line. The println() method prints the string and moves to a new line. Program Program Source class Javaapp { public static void main(String[] args) { System.out.print(“Java is a high-level programming “); System.out.println(“language originally developed by “); System.out.print(“Sun Microsystems and released … Read more…

Java-Explanation of First Program

Program   Class Declaration The first line class Javaapp declares a class, which is an object-oriented construct. Java is a true object-oriented language and therefore, everything must be placed inside a class. class is a keyword and declares that a new class definition follows. Javaapp is a Java identifier that specifies the name of the … Read more…