Open Notepad and type the following:-
public class ex1
{
public static void main(String[] args)
{
System.out.println("Hello Java!");
}
}
public class ex1
{
public static void main(String[] args)
{
System.out.println("Hello Java!");
}
}
- Save the file in desktop.
- Open cmd in windows or terminal in Linux.
- In windows enter cd desktop
- to compile enter javac <file_name>.java //in this condition this is ex1.
- then enter java <file_name> // to run the bytecode.
No comments:
Post a Comment