Java Basics Tutorial



This tutorial is a brief overview of What Is Java, why it was needed and its functionality. We will look at the history of java and why there was a need to learn java and develop it. After that we will discuss the following characteristics of Java.
Java is Platform free

1. Object oriented
2. Platform Independent
3. Distributed
4. Robust
5. Secure
6. Multithreaded
Step 1- Java Introduction
What Is Java, well Java is the programming language just like any other. Superficially it looks like C/C++. If you know them it will be very easy to learn java. It has various set of libraries that makes Java a very powerful language.
In daily life you see many applications built on Java. Today Java applications are on Web browsers and Desktop used all over the world.
Java Beginning

Step 2 – History of Java:
In 1991 a team of Sun Microsystems decided to develop a small, fast and portable language that would run on any device. At that time the focus was to run it on small devices like TV, microwave and ovens etc.
And after 5 years Java was released in 1995.
Java Backgroud

Step 3: Java is Platform Independent
Platform independent language means the execution of the program is not restricted by the Environment provided by OS. Java is platform Independent because it generates byte code when program is compiled. Then byte code can be easily interpreted by any Java Virtual Machine that is available with every type of OS.
Java infrastructure

Step 4: Java is Object Oriented:
What Is an Object?
An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life.
What Is a Class?
A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object.
What Is an Interface?
An interface is a contract between a class and the outside world. When a class implements an interface, it promises to provide the behavior published by that interface. This section defines a simple interface and explains the necessary changes for any class that implements it.
Java is dispersed

Step 5: Java is distributed:
Java is designed as distributed language because for creating applications on network. It has the ability to share the data and programs over the Lan(local area network) using TCP/IP sockets. Java apps can open the remote objects or internet as easily they can do in local systems.
Java is safe

Step 6: Java is Secure
Java provides file access restriction to the applications across the network. So once you have set the read/write rights to the file it is secure from the other applications over the network. Java compiler also ensures that Java source code doesn’t violate the safety rules, when an application imports a code fragment from anywhere, it doesn’t actually know if code fragments follow Java language rules for safety thus verifying byte code ensures safety.
Java is thorough

Step 7: ROBUST
The Java compiler catches more compile-time errors; other languages (like C++) will compile programs that produce unpredictable results. Java does not allocate direct pointers to memory. This makes it impossible to accidentally reference memory that belongs to other programs or the kernel. Java also provides bound checking which makes sure that memory of a program is not going out of bound and accessing other program’s memory.
Java is preloaded with multithreads

Step 8: Java supports multithreading
Java is inherently multi-threaded. A single Java program can have many different threads executing independently and continuously. Three Java applets on the same page can run together with each getting equal time from the CPU with very little extra effort on the part of the programmer.