Java Notes
Java Notes
Use of comments: For understandability, To Stop/Pause the execution temporarily so that part gets run for testing
We store program with .java extension. Aswe already set class path we can store in any editor. Prefer using some e
Entire program will always be in class boundary i.e. each line shall be with in class curly braces
Execution of each program starts from main method. If no main method program won't run
program name .java file name shall be equal to main method. Because program searches for it
To touch a method/variable we need to create an object first, it’s a must. To access with out that we hav
sometimes we may not write return statement then in such cases we must write void. Main metohd gen
String array allows us to pass input values to the main method by helping to store those input
To print anything: System.out.println("Hello World, Welcome")
step1 To compile anything: we need to write javac command. Eg javac programname.java
step2 To Execute just write java programname
Note: If classpath is not setup properly and tried running program below error comes
JIT: Just In Time compilter
interpreter & JIT compiler together converts .class file to binary code (because these two its much faster
umentation
er & JIT compiler together converts .class file to binary code (because these two its much faster)