Let's have look on the first program of java. Here we are taking a simple code through which we want to see “welcome to java” on the output screen.
class Example
{
public static void main(String args[])
{
System.out.println("welcome to java");
}
}
Output- welcome to java
Let's take one more example. Here we want to get “hello world” on the output screen.
class Example
{
public static void main (String args[])
{
System.out.println("hello world");
}
}
Output- hello world
How to run java Program;
In these days there are multiple ways to run a java program. Some of these are listed below,
1. Command Prompt
2. Eclipse
3. NetBeans
4. Android phone
Thank you!!
For Videos Join Our Youtube Channel: Join Now