About Java and Hostory:: Designed by Sun Microsystems
About Java and Hostory:: Designed by Sun Microsystems
Summary
In the next chapter we are going to see difference between two major and most widely spread
languages – C# and Java.
What is Java ?
Java is widely used programming language which has wide verity of applications such as
desktop applications, Mobile Applications, Enterprise applications etc.
[box]
Java is a –
[/box]
A. Java Applets :
1. An applet is a special kind of Java program that is designed to be transmitted over the
Internet and automatically executed by a Java-compatible web browser.
2. Applet can be downloaded on demand.
3. Applet programs can be run on ant java compatible browser.
4. Applets are intended to be small programs.
5. They are typically used to display data provided by the server, handle user input, or
provide simple functions, such as a loan calculator, that execute locally, rather than on
the server.
6. In essence, the applet allows some functionality to be moved from the server to the
client.
B. Security :
1. Applets can be downloaded to user PC .
2. They are executed independently without accessing other parts of user’s PC.
3. The ability of Java provides security and thus Java prove itself more secure.
C. Portability :
1. Java Programming is Portable.
2. Java Program is Operating System Independent.
3. Java Program is converted into byte code and byte code is executed by JVM. [ See how
Java Code is Portable ? ]
4. Java Applets are thus portable and can be downloaded from any place in globe and can be
executed on java compatible browser thus making java programs portable.
In the next chapter we are going to see How Java Programming is Platform Independent ? Which
Aspects of Java make it to behave independently regardless of hardware use ?
[box]
Important Note :
As the output of Java Compiler is Non Executable Code we can consider it as Secure (it cannot
be used for automated execution of malicious programs).
[/box]
4. JVM is an interpreter.
5. JVM accepts Bytecode as input and execute it.
6. Translating a Java program into bytecode makes it much easier to run a program in a
wide variety of environments because only the JVM needs to be implemented for each
platform.
7. For a given System we have Run-time package , once JVM is installed for particular
system then any java program can run on it.
8. However Internal details of JVM will differ from platform to platform but still all
understand the Same Java Bytecode.
1. When a program is interpreted, it generally runs slower than the same program would run
if compiled to executable code.
2. In Java Compiler will generate ByteCode which is highly optimized.
3. Thus running highly optimized code using interpreter makes execution of java program
faster.
Secure :
Portable :
Java programs can execute in any environment for which there is a Java run-time system.
(JVM)
Java programs can be run on any platform (Linux,Window,Mac)
Java programs can be transferred over world wide web (e.g applets)
Object-oriented :
Robust :
Java encourages error-free programming by being strictly typed and performing run-time
checks.
Multithreaded :
Architecture-neutral :
Interpreted :
Distributed :
Dynamic :
Java programs carry with them substantial amounts of run-time type information that is
used to verify and resolve accesses to objects at run time.
3. After Clicking on the Java Logo it will redirect you to the actual download page.
4. On the download page you have to click on radio button to accept terms and conditions of
oracle.
[box]I am running java on Window 7 (64-bit) therefor i will select suitable version for me –
[ jdk-7u17-windows-x64.exe ][/box]
In the next tutorial we are going to see how to install JDK.
In this tutorial we are going to see how to install JDK. In the previous tutorial we have learned ,
how to download proper version of jdk setup from oracle site. This tutorial will provide you step
by step guide for installing jdk –
5. It will prompt you optional features to be installed. Let it be default. Now click on “next”.
6. Now Keep Path as default.
After following series of above screenshots finish window will gets opened. Now next step is to
setting up class path so that you can run java programs.
In previous tutorial we have learned , how to install jdk. In this tutorial we are going to check
whether java is installed correctly or not.
3. These two folders gets created inside “My Computer => C Drive => Program File =>
Java“.
4. Check Inside JDK folder and look for “java” , “javac” application files.
5. If these files are present then 75% we are on right track. Now Let’s Check whether
“javac” is working properly or not.
class hello
{
public static void main(String args[])
{
System.out.println("Welcome to Java");
}
}
C:Usersp.abhiman.taral>cd
C:>cd code
C:code>javac hello.java
C:code>java hello
Welcome to Java
C:code>
If you are successful in getting “Welcome to Java” then you have installed java Correctly.
In previous tutorial we have learned , how to install jdk. In this tutorial we are going to check
whether java is installed correctly or not.
How to Check whether (Jdk) java is Installed or not ?
Step 1 : Checking Directory Structure
3. These two folders gets created inside “My Computer => C Drive => Program File =>
Java“.
4. Check Inside JDK folder and look for “java” , “javac” application files.
5. If these files are present then 75% we are on right track. Now Let’s Check whether
“javac” is working properly or not.
class hello
{
public static void main(String args[])
{
System.out.println("Welcome to Java");
}
}
C:Usersp.abhiman.taral>cd
C:>cd code
C:code>javac hello.java
C:code>java hello
Welcome to Java
C:code>
If you are successful in getting “Welcome to Java” then you have installed java Correctly.