-
Notifications
You must be signed in to change notification settings - Fork 5
java
Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It was designed to write once, run anywhere which mean the code can be compiled just once, and can run on any platform after that without compiling. It is one of the most popular language in use as of 2015 with a reported 9 million developers.
Java language project was started in june of 1991, the creator like to consume Java coffee so it was named Java. The syntax was very similar to that of C/C++. Because of the ability to run Java applets within web pages it quickly grew in popularity. In 2006, much of Java was released as free and open-sourced software under the terms of GNU General Public License.
There were five primary goals in the creation of the Java language:
It must be "simple, object-oriented and familiar"
It must be "robust and secure"
It must be "architecture-neutral and portable"
It must execute with "high performance"
It must be "interpreted, threaded, and dynamic"
In a .java file there can be only one public class, but it can contain multiple classes with other than public access and any number of public inner classes. Source files must be named after the public class they contain appending the suffix .java. Once compiled with a Java compiler, a .class file with same name would be created. All code is written inside classes. A class is blueprint for creating objects. Every data item is an object. By convention, method names begin with a lowercase first letter and subsequent words in the name begin with a capital letter.
Public = can be used by classes outside the class hierarchy.
Static = static method, which one can call it without first creating an object of the class in which the method is declared.
Void = does not return any value to the caller.
Import = which is used at the beginning to specify classes or packages to be referred to later without including their package names. import java.util.*; which import every class under util import java.util.Scanner; which import the Scanner class