What is Java ?
- Java is an object oriented programming language as well as a platform.
- It was developed by James Gosling in 1995 at Sun Microsystems now Oracle.
- It is a platform independent programming language.
- The cross-platform compatibility is also known as “Write Once, Run Anywhere (WORA)”
What is bytecode in Java?
- Bytecode is a highly optimized set of machine code used by JVM (Java Virtual Machine).
- It is created by the Java compiler during compilation in the form of a (. class file) with the help of which platform independence feature is achieved.
What is JVM (Java Virtual Machine) ?
- Load Codes
- Verifies Codes
- Executes Codes
- Provides run time environment
- JVM stands for Java Virtual Machine.
- It is an abstract machine also known as Java Interpreter.
- It is a specification that provides run time environment in which a java bytecode can be executed. Java Virtual Machine performs the following main tasks:
What is JRE (Java Runtime Environment) ?
- JRE acronym for Java Runtime Environment
- JRE is an implementation of JVM
- It is a set of software tools used for developing Java applications.
- It contains a set of libraries and other files used by JVM at runtime.
What is JDK (Java Development Kit) ?
- JDK stands for Java Development Kit
- JDK is a development kit which provides environment to develop java applications and applets.
- It contains JRE + JVM + other development tools.
- It is only used by java developers.
What are the features of a Java language ?
- It is an object oriented programming language.
- It is platform independent
- It is case sensitive language.
- It is portable in nature.
- It is open source.
- It supports multi-threading.
- It is architecture neutral.
- It is secure.
- It has features of exception handling.
- It supports high performance.
What are Comments ?
- Comments in java are non-executable statements.
- It is used to increase the readability of the program.
- It provides additional information about the program by the programmer, for programmers future use.
- Comments are basically of 3 types.
- Single-line comments: Single-line comments is used for a single line preceded with (//) symbol before the beginning of the statement. It also known as End of line comments. Example: // This is an example of single line comment
- Multi-line comments: Multi-line comments is used for multiple line where (/*) symbol is preceded before the beginning of the text and ends with (*/) symbol . It is also known as block comments. It is also known as block comments. Example:/* This is an example of multi line comments. Developed by Vikash Kumar at Java2successc.com */
- Documentation comments: Documentation comments is used for a large code of programming bundle. It is used to produce a HTML file that documents the program with the help of javadoc utility. It is preceded with (/**) symbol before the beginning of the first statement and ends with (*/) symbol. Example: /**
* Method to find average
* @param numA- This is the first parameter to calculateSum method
* @param numB – This is the second parameter to calculateSum method