A simple program in java, How to Write Program in Java
Let us begin with a simple Java program that displays the message “Welcome To Java!
Java is an Object Oriented Prog Language!” on the console.
Output
Welcome To Java!
Java is an Object Oriented Prog Language!
Here is an another program to display multiple messages
Welcome1.java
public class Test
{
public static void main(String[] args)
{
System.out.println("Java is an Object Oriented Prog Language!");
System.out.println("Java is Robust!");
System.out.println("I love Programming!");
}
}
Output
Java is an Object Oriented Prog Language!
Java is Robust!
I love Programming!
Let us begin with a simple Java program that displays the message “Welcome To Java!
Java is an Object Oriented Prog Language!” on the console.
Welcome.java
class Test
{
public static void main(String st[])
{
System.out.println("Welcome To Java!\n Java is an Object Oriented Prog Language!"); // Display the message on console
}
}Output
Welcome To Java!
Java is an Object Oriented Prog Language!
Here is an another program to display multiple messages
Welcome1.java
public class Test
{
public static void main(String[] args)
{
System.out.println("Java is an Object Oriented Prog Language!");
System.out.println("Java is Robust!");
System.out.println("I love Programming!");
}
}
Output
Java is an Object Oriented Prog Language!
Java is Robust!
I love Programming!
{ 0 comments... read them below or add one }
Post a Comment