How to use Java Declaring and Initializing Variables in java code in side ? Its easy to Use
Ex :
String name = "baby"
----------------------------------------
💡Tips
java is case sensitive ( Capital letter & simple letter )language.
Use Variable name correctly your code
-----------------------------------------------------
class Hello { public static void main(String args[]){
String name = "java"; // Declaring and Initializing Variables
System.out.println("My Name is" + name ) ;
}
}
code Here
public class HelloJava {
public static void main(String[] args) {
String j = "java"; // Declaring and Initializing Variables
System.out.println(j+ " is invented by James Gosling and others in 1994.");
System.out.println("Gosling was writing a new language, which he named “Oak”.");
System.out.println(j + " was originally named Oak.");
System.out.println("Oak became “" + j + "”. ");
}
Code Here
Tags:
Java