☆Class body:-
➖After class declaration, open in curly braces and closed curly braces represent class body.
➖In a class body, programmer can be declare data members, member functions, blocks and constructor.
➖If programmer want to declare any executable statements then those statements need to be declared inside class body.
➖Declaring executable statements outside class body throws error.
(It is because of Encapsulation rule).
➖After class declaration, open in curly braces and closed curly braces represent class body.
➖In a class body, programmer can be declare data members, member functions, blocks and constructor.
➖If programmer want to declare any executable statements then those statements need to be declared inside class body.
➖Declaring executable statements outside class body throws error.
(It is because of Encapsulation rule).
☆Main method:-
➖Main method places very important role in execution of java program because of main method is the entry point of Java program.
➖Without main method compilation takes place but execution don't.
➖Main method places very important role in execution of java program because of main method is the entry point of Java program.
➖Without main method compilation takes place but execution don't.
Ex:-
class Demo
{
public static void main(String [] args)
{
System.out.println("Hello");
}
}
javac Demo.java
java Demo
O/p:- Hello
class Demo
{
public static void main(String [] args)
{
System.out.println("Hello");
}
}
javac Demo.java
java Demo
O/p:- Hello
☆print:-
➖Prints the output and the cursor remains in the same line.
☆println:-
➖Prints the output and the cursor jumps to the next line.
➖Prints the output and the cursor remains in the same line.
☆println:-
➖Prints the output and the cursor jumps to the next line.
Ex:-
Ex:-
class Demo1
{
public static void main(String [] args)
{
System.out.print("Hello all");
System.out.println("Hello");
}
}
javac Demo1.java
java Demo
O/p:- Hello allHello
_ (cursor)
Ex:-
class Demo1
{
public static void main(String [] args)
{
System.out.print("Hello all");
System.out.println("Hello");
}
}
javac Demo1.java
java Demo
O/p:- Hello allHello
_ (cursor)
System.out.println("HI");
HI
System.out.println(2);
2
System.out.println("HI+HELLO");
HI+HELLO
System.out.println("2+2");
2+2
System.out.println(2+2);
4
System.out.println("hi"+"hello");
hihello
System.out.println("hi"+"hello"+"2+2");
hi+hello2+2
System.out.println(2+2+"hi");
4hi
System.out.println("hi"+2+2);
Hi22
System.out.println(2+2+"hi"+2+2);
4hi22
System.out.println("hi"+(2+2));
hi4
HI
System.out.println(2);
2
System.out.println("HI+HELLO");
HI+HELLO
System.out.println("2+2");
2+2
System.out.println(2+2);
4
System.out.println("hi"+"hello");
hihello
System.out.println("hi"+"hello"+"2+2");
hi+hello2+2
System.out.println(2+2+"hi");
4hi
System.out.println("hi"+2+2);
Hi22
System.out.println(2+2+"hi"+2+2);
4hi22
System.out.println("hi"+(2+2));
hi4
☆Java software installation:-
➖To deal with java programming language two software are essentials.
1. JDK
➖JDK stands for Java Development Kit, it is used to design and develop java programs.
➖Inside JDK many readymade frameworks or classes are present.
➖With the help of those readymade classes frameworks applications can be developed instantly.
➖To deal with java programming language two software are essentials.
1. JDK
➖JDK stands for Java Development Kit, it is used to design and develop java programs.
➖Inside JDK many readymade frameworks or classes are present.
➖With the help of those readymade classes frameworks applications can be developed instantly.
2. JRE
➖JRE stands for Java Runtime Environment, it is used to execute Java programs.
➖Java programming language makes use of many API(Application Programming Interface) to provide very good security for applications.
➖JRE stands for Java Runtime Environment, it is used to execute Java programs.
➖Java programming language makes use of many API(Application Programming Interface) to provide very good security for applications.
☆Configuring JDK software with OS(Operating System):-
➖After installation of JDK software visit inside below declared folder
C:\.......
➖copy the url
➖open system property window
Computer》Properties》Advanced system settings》Environment variables》system variables》PATH》PASTE THAT URL.
➖It pop-up window appears on the screen, the already some information will be predeclared. Don't manipulate that information, after information tyle ';' and paste the jdk url
➖Open the command prompt and type Java, a list of predeclared commands related to java appears on the screen. If not then crosscheck with configuration steps.
➖After installation of JDK software visit inside below declared folder
C:\.......
➖copy the url
➖open system property window
Computer》Properties》Advanced system settings》Environment variables》system variables》PATH》PASTE THAT URL.
➖It pop-up window appears on the screen, the already some information will be predeclared. Don't manipulate that information, after information tyle ';' and paste the jdk url
➖Open the command prompt and type Java, a list of predeclared commands related to java appears on the screen. If not then crosscheck with configuration steps.
☆Java program Execution flow:-
➖Java program execution flow involves three steps process, they are
1. Coding
2. Compilation
3. Execution
➖Java program execution flow involves three steps process, they are
1. Coding
2. Compilation
3. Execution
➖User declared java programs(.java) is considered to be as source file.
➖Once the source file is ready programmer need to invoke compiler to perform compilation operation.
➖The below declared command is used to invoke compiler
javac Filename.java
➖Once the source file is ready programmer need to invoke compiler to perform compilation operation.
➖The below declared command is used to invoke compiler
javac Filename.java
➖The work of compiler is, it compares user declared java program with standard java syntex(present inside java library).
➖This comparison is perform to detect syntactical mistakes. If any mistakes perform then compiler display fully qualified mistakes on screen.
➖If no mistakes perform, then compiler generate new file(compilation successful)
➖The newly generated file is considered to be as .class file or intermediate file.
➖The content of .class file is bytecode.
➖Once .class file is generated programmer need to invoke JRE or JVM for execution.
➖The below declared cmd is used to invoke JRE or JVM.
java ClassName
➖This comparison is perform to detect syntactical mistakes. If any mistakes perform then compiler display fully qualified mistakes on screen.
➖If no mistakes perform, then compiler generate new file(compilation successful)
➖The newly generated file is considered to be as .class file or intermediate file.
➖The content of .class file is bytecode.
➖Once .class file is generated programmer need to invoke JRE or JVM for execution.
➖The below declared cmd is used to invoke JRE or JVM.
java ClassName
➖JRE is just a folder name, inside JRE there is a powerful tool present called JVM (Java Virtual Machine).
➖JVM is responsible for executing .class file.
➖Inside JVM, there are three imp blocks. They are,
1. Class Loader
➖Responsible for loading .class file from system memory to JVM memory.
➖One .class file can be loaded only once throught lifetime of the app.
➖Class loader loads .class file only
➖JVM is responsible for executing .class file.
➖Inside JVM, there are three imp blocks. They are,
1. Class Loader
➖Responsible for loading .class file from system memory to JVM memory.
➖One .class file can be loaded only once throught lifetime of the app.
➖Class loader loads .class file only
2. Byte Code Checker
➖For security reason the loaded .class file is again cross verified in it.
➖For security reason the loaded .class file is again cross verified in it.
3. JIT - Just in Time Compiler
➖It is responsible for converting machine understandable language into user understandable language.
➖It performs the operation line by line and hence JIT is also known as interpreter.
➖It is responsible for converting machine understandable language into user understandable language.
➖It performs the operation line by line and hence JIT is also known as interpreter.
The account of the user that created this channel has been inactive for the last 5 months. If it remains inactive in the next 29 days, that account will self-destruct and this channel will no longer have a creator.
The account of the user that created this channel has been inactive for the last 5 months. If it remains inactive in the next 19 days, that account will self-destruct and this channel will no longer have a creator.
The account of the user that created this channel has been inactive for the last 5 months. If it remains inactive in the next 9 days, that account will self-destruct and this channel will no longer have a creator.
Follow my page @codelytics for programming knowledge.
https://instagram.com/codelytics?igshid=lt2hb5amh983
https://instagram.com/codelytics?igshid=lt2hb5amh983