What is Java?
Java is a popular programming language, created in 1995.
It is owned by Oracle, and more than 3 billion devices run Java.
It is used for:
o Mobile applications (specially Android apps)
o Desktop applications
o Web applications
o Web servers and application servers
o Games
o Database connection
o And much, much more!
Java Quickstart
In Java, every application begins with a class name, and that class must match the filename. Let's create our first Java file, called Main.java, which can be done in any text editor (like Notepad). The file should contain a "Hello World" message, which is written with the following code:
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Java Syntax
In the previous chapter, we created a Java file called Main.java, and we used the following code to print "Hello World" to the screen:
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
The main Method
The main() method is required and you will see it in every Java program:
public static void main(String[] args)
System.out.println()
Inside the main() method, we can use the println() method to print a line of text to the screen:
public static void main(String[] args) {
System.out.println("Hello World");
}
JAVA PROGRAMMINGMake sure you contact us.