Introduction to JAVA Programming
Introduction To JAVA and Its History
Java is very popular programming language which works on different platforms like Windows, Mac, Linux, Raspberry Pi, etc...
*It is one among the foremost popular programing language within the world
*It is easy to find out and straightforward to use
It is open-source and free
*It is secure, fast and powerful
*It has an enormous community support (tens of many developers)
Java is an object oriented language which provides a transparent structure to programs and allows code to be reused, lowering development costs.
As Java is on the brink of C++ and C#, it makes it easy for programmers to modify to Java or the other way around
History::
JAVA was created by James Gosling at Sun Microsystems Inc in the year 1991, later gained by Oracle Corporation. It is a straightforward programming language. Java makes composing, gathering, and troubleshooting(debugging) programming simple. It assists with making reusable code and secluded projects.
Java is a class-based, object-situated programming language and is intended to have as hardly any execution conditions as could really be expected. A universally useful programming language made for engineers to compose once run anyplace that is arranged Java code can run on all stages that help Java. Java applications are compile to byte code that can run on any Java Virtual Machine. The syntax structure of Java is like c/c++.
Java's set of experiences is exceptionally intriguing. this programming language made in 1991. James Gosling, Mike Sheridan, and Patrick Naughton, a group of Sun engineers known as the Green team started the Java language in 1991.Sun Microsystems passed on its first open execution in 1996 as Java 1.0.It gives no-cost - run-times on mainstream platforms. Java1.0 compiler was re-written in Java by Arthur Van Hoff to rigorously agree with its particulars. With the appearance of Java 2, new forms had various configuration worked for various sorts of platforms.
In 1997, Sun Microsystems pushed toward the ISO rules body and later formalized Java, yet it after a short time pulled out from the process. At one time, Sun made the majority of its Java executions accessible without charge, in spite of their restrictive programming status. Sun created income from Java through the selling of licenses for specific items like the Java Enterprise System.
On November 13, 2006, Sun conveyed a considerable amount of its Java virtual machine as free, open-source programming. On May 8, 2007, Sun completed the process, making the entirety of its JVM's code accessible under open-source dissemination terms.
why name is java::
After the name OAK, the group chose to give another name to it and the recommended words were Silk, Jolt, DNA, dynamic, and so on These all names were not difficult to spell and enjoyable to say, yet they all needed the name to mirror the quintessence of innovation. As per James Gosling, Java the among the top names alongside Silk, and since java was a one of a kind name so the vast majority of them favored it. Java is the name of an island in Indonesia where the first coffee(named java coffee) was created. Furthermore, this name was picked by James Gosling while at the same time having coffee close to his office. Note that Java is only a name, not an abbreviation.
Java Terminology:
This is for the mostly known to as JVM. There are three execution periods of a program. They are composed, assemble and run the program. writing a program is finished by a java developer like you and me.
The assemblage or compilation is finished by the JAVAC compiler which is an essential Java compiler remembered for the Java development kit(JDK). It takes Java program as information and produces bytecode as output.
In the Running period of a program, JVM executes the bytecode produced by the compiler.
1. Java Virtual Machine:: we comprehended that the capacity of Java Virtual Machine is to execute the bytecode delivered by the compiler. Each Operating System has an alternate JVM yet the output they produce after the execution of bytecode is something similar across every one of the operating systems. This is the reason Java is known as a platform-independent language.
2. Bytecode in the Development process:
the Javac compiler of JDK assembles the java source code into bytecode with the goal that it tends to be executed by JVM. It is saved as .class document by the compiler. To see the bytecode, a disassembler like javap can be utilized.
3. Java Development Kit(JDK):
For the program to execute in java, we need to install JDK on our PC to make, compile and run the java program.the name proposes, it is a finished Java development pack that incorporates everything including compiler, Java Runtime Environment (JRE), java debuggers, java docs, and so forth
4. Java Runtime Environment (JRE):
JRE installation on our PCs permits the java program to run, in any case, we can't compile it. JRE incorporates a program like browser, JVM, applet supports, and modules plugins. a PC needs JRE, For running the java program
5. Garbage Collector:
In Java, programmers can't erase the objects. To erase or remember that memory JVM has a program called Garbage Collector. Garbage collector can recall the of objects that are not referred to. So Java makes the existence of a programmers simple by dealing with memory management.
6. ClassPath:
The classpath is the file's path where the java runtime and Java compiler search for .class files path to load. As a matter of course, JDK provides numerous libraries. Assuming you need to incorporate outer libraries they ought to be added to the classpath.
Features of JAVA
1) Platform independent::
Compiler changes over source code to bytecode and afterward the JVM executes the bytecode produced by the compiler. This bytecode can run on any platform like Windows, Linux, macOS which implies on the off chance that we arrange a program on Windows, we can run it on Linux and the other way around. Each operating system has an alternate JVM, yet the output delivered by all the OS is something very similar after the execution of bytecode. That is the reason we consider java a platform independent language.
2. Object-Oriented Programming Language:
Putting together the program in the terms of collection of objects is a way of object oriented programming, every one of each instances an example of the class.
The four fundamental ideas of Object-Oriented programmings:
* Abstraction:::
it is a process of hiding of unessential details and showing only essentials property or functionality to the user.
* Encapsulation::
process of wrapping data members and member functions into a single unit,
* Inheritance::
it is a concept of acquiring the properties from one class to other classes
* Polymorphism::
it can be ability of a message to be displayed in more than one form.
3. Simple programming language:
Java is one of the basic dialects as it doesn't have complex highlights like pointers, operator overloading , Explicit memory allocation and multiple inheritance.
4. Robust:
Java language is powerful that means reliable. It is created so that it invests a great deal of energy into checking errors as ahead of schedule as could really be expected, that is the reason the java compiler can distinguish even those errors that are difficult to recognize by another programming language. The primary highlights of java that make it powerful are Exception Handling, memory allocation, garbage collection.
5. Secure:
In java, we don't have pointers, thus we can't access out-of-bound clusters that means it shows ArrayIndexOutOfBoundsException on the off chance that we attempt to do as such. That is the reason a few security blemishes like buffer overflow is difficult to exploit in Java.
6. Distributed:
We can make distributed applications utilizing the java programming language. Far off remote Method Invocation and Enterprise Java Beans are utilized for making distributed applications in java. The java projects can be effectively distributed on at least one system that are associated with one another through a internet.
7. Multithreading and portable:
Java supports for multithreading. It is a Java highlight that permits simultaneous execution of at least two pieces of a program for greatest use of CPU.
portable: java code composed on one machine can be run on another machine. The platform autonomous element of java in which its platform free bytecode can be taken to any stage for execution makes java convenient.
Example Of Java:
import java.io.*;
OUTPUT:
Hello Technical Tanu
Comments
Post a Comment