|
Explain the various features of the java programming
language.
Various features of java programming language are as given below: 1. Java is very simple programming language.Even
though you have no programming background you can learn this language comfortably.
Why java is known as Platform-independent language? Java is called Platform independent because the programs in java can be executed on variety of systems.This feature is based on the goal “write once, run anywhere and at anytime, forever”. What do you mean by BYTECODE? What is JVM and JIT? Bytecode is an intermediate form of java programs. Bytecode consists of optimized set of instructions that are not specific to processor. We get bytecode after compiling the java program using a compiler called javac. The bytecode is to be executed by java runtime environment which is called as Java Virtual Machine (JVM). The programs that are running on JVM must be compiled into a binary format which is denoted by .class files. The JVM executes .class or .jar files, by either interpreting it or using a just-in-time compiler (JIT). The JIT is used for compiling and not for interpreting the file. It is used in most JVMs today to achieve greater speed. The bytecode verifier verifies all the bytecode before it is executed. Explain the general java program execution.
Describe the typical java program structure. Any java program can be written using simple text editor like notepad or WordPad. The file name should be same as the name of the class used in the corresponding java program. The extension of the file name should be .java. FirstProgram.java
Explanation:- In our First Java program, on the first line we have written
a comment statement.This is a multi-line comment.
class FirstProgram
public static void main(String args[])
The parameter which is passed to main is String args[]. Hence String is a class name and args[] is an array which receives the command line arguments when the program runs, System.out.println(“This is first program”); To print any message on the console println is a method in which the string “This is first program” is written. After println method, the newline is invoked. Java program is a case sensitive programming language like C or C++. |
|
See also
Ask It in The Java Forum Java Books
Return to : Java Programming Hints and Tips All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|