Java Basics
Java is programming language like C,C++. It is used used to develop standalone, web, enterprise, mobile application .
Feature of Java:
1)Simple:
Java is simple programming language as the concept of pointers, operator overloading has been removed from the java.
2)Object oriented programming.
Java follow the oops concepts. This is the most important feature of java.
Following are the oops concept:
1)Object.
2)Classes.
3)Encaspulation
4)Abstration
5)Inheritance
6)Polymorphism.
3) Multithreaded:
This is also one of the main feature in java. Java provide API with which we can develop with the multithreaded application
4)Distrubuted.
Using RMI and EJB we can develop distributed application.
5)Platform independent:
Code written in java is able to run on any platform. This is the magic of JVM (java virtual machine) which tranform the byte code which is compiled java code into platform specific code.
6)Portable.
Java program is portable means,java program can run on any hardware where the JVM runs.
Hello World Java Program:
class HelloWorld{
public static void main(String args[]){
System.out.Println("Hello World!");
}
}
This is the simple program in java. This program is used to print the "Hello World!" on console.
We need create the class to write any class in java and one main method we need to write JVM will call this method when we run this program.
Steps to execute the program:
1)Save this program with HelloWorld.java.
2)Compile this program using JAVAC utility.
3)Run the compiled byte code using JAVA interpreter.
>javac HelloWorld.java
>java HelloWorld
>Hello World!
========================================================================
Java is programming language like C,C++. It is used used to develop standalone, web, enterprise, mobile application .
Feature of Java:
1)Simple:
Java is simple programming language as the concept of pointers, operator overloading has been removed from the java.
2)Object oriented programming.
Java follow the oops concepts. This is the most important feature of java.
Following are the oops concept:
1)Object.
2)Classes.
3)Encaspulation
4)Abstration
5)Inheritance
6)Polymorphism.
3) Multithreaded:
This is also one of the main feature in java. Java provide API with which we can develop with the multithreaded application
4)Distrubuted.
Using RMI and EJB we can develop distributed application.
5)Platform independent:
Code written in java is able to run on any platform. This is the magic of JVM (java virtual machine) which tranform the byte code which is compiled java code into platform specific code.
6)Portable.
Java program is portable means,java program can run on any hardware where the JVM runs.
Hello World Java Program:
class HelloWorld{
public static void main(String args[]){
System.out.Println("Hello World!");
}
}
This is the simple program in java. This program is used to print the "Hello World!" on console.
We need create the class to write any class in java and one main method we need to write JVM will call this method when we run this program.
Steps to execute the program:
1)Save this program with HelloWorld.java.
2)Compile this program using JAVAC utility.
3)Run the compiled byte code using JAVA interpreter.
>javac HelloWorld.java
>java HelloWorld
>Hello World!
========================================================================
No comments:
Post a Comment