Monday, 30 April 2018

Java Tutorial From Basics

Step By Step Learning of JAVA : 


Java History : 


Java was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language.  Writing, compiling and debugging a program is easy in java.  It helps to create modular programs and reusable code. 


Java is an Object Oriented language


Object oriented programming is a way of organizing programs as collection of objects, each of which represents an instance of a class.
4 main concepts of Object Oriented programming are:
  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism

Run First Java Program: Here


You can Mail is you face any issues.
Mail: rajan.sethi36@gmail.com
Thanks.



Run your First Java Program


How to Compile and Run your First Java Program


Simple Java Program:


Create a java project in IDE. Create package in src and java class in that package.

public class demoFirstProgram {
  public static void main(String[] args){
    System.out.println("This is my first program in java");
  }//End of main
}

Explanation of the Code:


public static void main(String[] args)  {
This is our next line in the program, lets break it down to understand it: public: This makes the main method public that means that we can call the method from outside the class.
static: We do not need to create object for static methods to run. They can run itself.
void: It does not return anything.
main: It is the method name. This is the entry point method from which the JVM can run your program.
(String[] args): Used for command line arguments that are passed as strings.
System.out.println("This is my first program in java");
This method prints the contents inside the double quotes into the console and inserts a newline after.
You can Mail is you face any issues.
Mail: rajan.sethi36@gmail.com
Thanks.