News

Tuesday, August 31, 2021

00 || Introduction to Java Programming || Java Full Course via NetBeans



1. Brief Introduction:

James Gosling developed Java at Sun Microsystems Inc in 1991, later obtained by Oracle Corporation. It is a basic programming language. Java makes composing, ordering, and troubleshooting programming simple. It is used in making reusable code and modular projects.

Java is a class-based, object-oriented programming language and is designed to have as few execution conditions as could be. A broadly useful programming language made for engineers to compose once run anyplace that is compiled Java code which run on all devices that support Java. Java applications are accumulated to byte code that can run on any Java Virtual Machine. The sentence structure of Java is same as of C and C++.


2. History:

Java's history is extremely interesting. This programming language was made in 1991. James GoslingMike Sheridan, and Patrick Naughton, a group of Sun engineers known as the Green Team started the Java language in 1991. Sun Microsystems delivered its first public implementation in 1996 as Java 1.0. It gives no-cost run-times on well known platforms. Java1.0 compiler was re-written in Java by Arthur Van Hoff to strictly conform to its particulars. With the appearance of the Java 2, new versions had various configurations worked for various sorts of platforms.

In 1997, Sun Microsystems moved toward the ISO standards body and later formalized Java, yet it very soon pulled out from the process. At one time, Sun made the greater part of its Java implementations accessible without charge, despite their exclusive software status. Sun created revenue from Java through the selling of licenses for specific items like the Java Enterprise System.

On November 13, 2006, Sun delivered a lot of its Java virtual machine as free, open-source application

On May 8, 2007, Sun completed the process, making entire of its JVM’s core code accessible under open-source distribution terms.

The standards for making java were basic, strong, protected, superior performance, multi-threaded, interpreted, dynamic, etc. James Gosling in 1995 created Java, who is known as the Father of Java. Right now, Java is utilized in phones, tablets, laptops, programming, pc and mobile games, business, education and so on.



3. Java Programming Language is named JAVA. Why?:

After the name OAK, the group decided to give another name to it and the recommended words were Silk, Jolt, revolutionary, DNA, dynamic, etc.  These all names were not difficult to spell and enjoyable to pronounce, yet they all needed the name to mirror the substance of technology. As per James Gosling, Java the among the top names alongside Silk, and since java was an unique name so the majority of them favored it.
Java is the name of an island in Indonesia where the first coffee(named java coffee) was delivered. What's more, this name was picked by James Gosling while at the same time having espresso close to his office. Note that Java is only a name, not abbreviation.

4. Java Terminology:

Before learning Java, one must understand very well below some common terms:

4.1. Java Development Kit (JDK): 

As the name itself suggests that it is a complete Java development kit that includes everything including JAVAC compiler, Java Runtime Environment (JRE), java debuggers, java docs, etc. That's why for the execution of program in java, we need to install JDK on our PC to make, arrange and run the java program.

4.2.  Java Virtual Machine (JVM): 

This is mostly referred to as JVM. There are three execution periods of a program. They are composing, compiling and running the program.

  • Composing a program is the work of a java programmer like you and me.
  • The Compiling is done by the JAVAC compiler which is an essential Java compiler already present in the Java development kit (Java JDK). It takes Java program as input and produces bytecode as of its output.
  • Running of program is done by JVM which executes or runs the bytecode created by the compiler.

Now we got that the purpose of Java Virtual Machine is to execute/run the bytecode created by the compiler. Each Operating System has an alternate JVM yet the output they produce after the execution of bytecode is similar across every OSs. This is the reason Java is known as a platform-independent language.

4.3. Bytecode Development process:  

As we talked, the Javac compiler of JDK gathers the java source code into bytecode so can be executed by JVM. It is saved as .class file by the compiler. To see the bytecode, a disassembler like javap can be utilized for this purpose.

4.4. Java Runtime Environment (JRE): 

JRE is present in JDK. Its installation installation on PCs permits or allows the java program to execute or run, but we can't compile (convert into bytecode) the java program with it. JRE also have a browser, JVM, applet supports, and modules. Thus at the end we needs JRE to run the java program.

4.5. Garbage Collector: 

In Java, developers can't erase the objects. For deleting or recollecting that memory JVM has a program called Garbage Collector. It can recollect the objects that are not referenced. Hence Java makes life of a programmer simple and easy by taking care of memory management. But, software engineers ought to be cautious and careful with their code whether they are utilizing objects that have been utilized for a long while because Garbage can't recover the memory of objects being referenced.

4.6. ClassPath: 

The classpath is the file path where the java runtime and Java compiler search for .class files documents to load and stack. By default, JDK gives numerous libraries. Assuming you need to incorporate outside or external libraries, these libraries ought to be added to the classpath.


5. Main Features of Java:

Following are the main features of Java that you must know these:

5.1. Platform Independent:  

Compiler changes source code to bytecode and afterward the JVM executes or runs the bytecode created by the compiler. This bytecode can run on any platform whether it's Windows, Linux, macOS which implies if we compile a program on Windows, then we can run it on Linux and the other platforms as well. Each OS has an alternate JVM, yet the output created by all the OS is similar after the execution of bytecode. That is the reason we say java is a Platform-independent language. Following are the main features of Java that you must know these:



5.2. Object-Oriented Programming Language:  

The programming language in which program is arranged on the basis of collection of objects (each represent specific class) is known as object-oriented programming language. 

There are four main process of object-oriented programming which are below: 
  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

5.3. Simple:  

Java is one of the straightforward languages because it doesn't have complex components like pointers, operator over-loading, various inheritances, explicit memory allocation etc.

5.4. Robust:  

Java language robust means that it's a reliable or dependable. It is created so that it invests a lot of energy into taking a look at errors or blunders as early as possible. That's the reason the java compiler can identify even those errors / mistakes that are difficult to recognize by another programming language. The main qualities of java that make it robust are Garbage Collection, Exception Handling, and Memory Allocation.

5.5. Secure:  

In java, we don't have pointers, thus we can't access out-of-bound exhibits i.e. it shows Array Index Out of Bounds Exception if we attempt to do such. That's the reason a few security blemishes like stack corruption or buffer overflow is difficult to exploit of in Java.

5.6. Distributed: 

We can make distributed applications utilizing the java programming language. Far off Method Invocation and Enterprise Java Beans are utilized for making distributed applications in java. The java projects can distributed on one or more frameworks / OS that are associated with one another through a web connection.

5.7. Multithreading: 

Java upholds multithreading. It's a Java quality that permits simultaneous execution of two or more than two pieces of a program for most extreme use of CPU.

5.8. Portable: 

As we aware, java code composed on one machine which then can be run on another machine or Operating Systems. The platform-independent quality of java in which bytecode can be taken to any OS  for execution, makes java a versatile or portable.




No comments:

Post a Comment