This site javatpoint is very useful for programming languages like JAVA,PYTHON,C,C++, Data Structures etc.Java learning Concept also provides technical materials , which are related to latest technologies. We provides very easy lectures to our viewers from beginning to advance level.We focus logical content instead of theoretical content.

Monday, 30 October 2017

My first Java program

My first Java program 

Now we can declare our first program in Java, IN this program we can understand how declare Java programs, which composts are require to create a Java program. And we can also discussed how can compile Java programs and run. So takes a example to understand Java programs. 

Class Sample 

{

Public static void main(String args[]   )

{

system. Out. Println("hello ");

}

}

Compile : we are compil Java programs by using the Javac command, it also known as Java compiler, the Java compiler convert source code (Java file) into byte code and run them through the Java virtual machine (jvm). 

Syntax:

 Javac java_file name

D:/pc> :   Javac sample.java


Run: we can run Java programs, uses Java keyword. When run Java programs, the jvm can be called main() method. Java programs are run through the Java virtual machine (jvm). 

Syntax:

Java Java file name

D:/pc> Java sample 

Explanation :In the program the class name is sampl.the program will be started with main()method. And we can display as output is hello. 




Out put: hello 



Adbox