Java is considered as one of the most powerful and popular programming language of all time because of below features.
Here we go .
Code-
- Security
- Portability
- Robust
- Object Oriented
- Architecture-neutral and etc
So Java is the one programming language which programmer can choice for the future career and whenever we talk about coding of any programming language we first code very first code "Hello World " Program
Here we go .
Code-
public class HelloWorld {Where to write the code-
public static void main(String[] args) {
System.out.println("Hello World");
}
}
- Open notepad (open run and type notepad hit enter)
- write the above code and save the file as HelloWorld.java(same as the class name ).
- open command prompt
- navigate to the file where you save the HelloWorld.java file in console.
- write below command
javac HelloWorld.java
- The above command will compile the program and create a file HelloWorld.class
- now run
java HelloWorld
Your Program will run and you will see in console "Hello World"
This is very basic and beginner's first program in java world.
Hope you guys will able to understand the program and if you are facing any problem do comment.
0 comments:
Post a Comment