What is Java?
- Java is a set of computer software and specifications developed by James Gosling, in the year 1996.
- Java is an open source free and efficient programming which build the steps for coding in android.
- It is used in the development of mobile applications and deploy it in cross-platform computing environment.
Components of Java:
- For the java program you basically need two components:
- JRE: Java Run time environment will enable you to run the program in your system but not develop.
- JDK: Java Development kit is the key component used for the development of applications.
- And it is one of the technologies from the three core technologies JVM (Java Virtual Machine) and JRE (Java Run time environment) which is very much important for the java compiler.
- The link given below will enable us to install jdk and jre:
- https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html
- And after the installation of jdk and jre you need to install eclipse which will run with the help of jdk and jre.
- The given link below is for the installation of eclipse:
- https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclipse-ide-java-developers
How Java works?
- . java files cannot be read by the computer so easily because it looks very difficult for it to read.
- So we have turn them into binary files which is done by the javac from the jdk.
- We have got a binary file for every .java class.
- And still the binary class also cannot be understood by the computer.
- The JVM can run any class file without any change.
Hello World Program:
- The basic terminologies to be included:
- public class: Public class in java means that a person can access the code or application publicly and can also modify the program until unless a code is declared as the final one.
- Public static void main: Public static void main means that you declare a main method within the Java application. It is the core point wherein it call any variable or data type.
- And will also not return to any values and accepts any parameters for complex command lines.
- String[] args: It stores Javacommand line arguments and is an array of type java. string class Here, the name of the String array is args but it is not fixed and user can use any name in place of it.
- Out. printlnis a Java statement that prints the argument passed, into the System. out which is generally stdout. System – is a final class in java.
- Now let us write the basic java program: (Hello World)
- public class tutorial {
- public static void main(String[] args){
- out.println(“Hello World”);
- }
- }
- // and the output will be:
- Hello World
Java setup for Mac:
- For setting up Java in mac the link given below can be followed.
- https://java.com/en/download/faq/java_mac.xml
- And the steps to be followed are:
- Step 1:
Step 2:
Step 3:
Step 4:
For JDK link is: : https://www.oracle.com/java/technolog…
For Setting Up Java in Windows:
The link for downloading JRE is : https://www.java.com/download/ie_manu…
- The steps to be followed are:
- Step 1:
Step 2:
Step 3:
Java:
This link guides you to the total information about java variables provided with visual clarity.
This link guides you to the total information about java data types provided with visual clarity.
This link guides you to the total information about java method and method overloading provided with visual clarity.
his link guides you to the total information about java looping.
This link guides you to the total information about java casting.