Thursday, July 30, 2020

Java - History and Evolution

Knowing the history and evolution is very important for any language. Lets look at the Java history and its evolution.

Java was started a project called "Oak" by Jemes Gosling, Mike Sheridan, and Patrick Naughton on June 1991. The name "Oak" was used by Gosling after an oak tree remained outside his office. Also oak is an image of solidarity and picked as notional tree of number of nations like USA, France, Romania etc. Later the project went by the name Green and after a lot of discussions the development team too a break and went out for Coffee. That's where the name Java was proposed and finalized by the team.

Gosling's goal was to implement an virtual machine and a language that had a familiar C-like notations but greater uniformity and simplicity than c++.  The team initiated the language development for digital devices such as set-top boxes, televisions etc.

Sun Microsystems released the first public use as Java 1.0 in 1996. It promised functionality of Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms. Fairly secure and featuring configurable security, it allowed network and file-access restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. 

The Java 1.0 compiler was re-written in Java by Arthur van Hoff to comply strictly with the Java 1.0 language specification. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 – 1999), new versions had multiple configurations built for different types of platforms. J2EE included technologies and APIs for enterprise applications typically run in server environments, while J2ME featured APIs optimized for mobile applications. The desktop version was renamed J2SE. In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively.

Evolution/Release of Java



sources:


Monday, July 27, 2020

Understand Java programming by Hello World Example

If you want to learn any computer programming languages, must starts with Hello World! example program. If we understand the this sample program, will learn around 25 to 30% basics and syntax, but generally we don't care about Hello World program and most of the time, just see it's a simple Hello World! message being printed and move on learn advance feature of it. That's were we lack our basics and programming syntax.

I will try to explain Java programming basics and it's syntax with help of Hello World! program. You can use Notepad, Eclipse or Intellij IDE to create sample program. As a beginner we must use Notepad, as progress and learn basics and syntax we can use the IDE.

package java.example;

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello World!");
}
}

The first line
package java.example;
specifies the package name were our class resides in. What is package in Java?
Well,
  • A package is a namespace that organizes a set of related classes and interfaces (will be discussed later blogs)
  • You can think of packages as being similar to different folders/directories on your computer
  • Packages are used in Java in order to prevent naming conflicts and access control
  • Interfaces and classes with the same name cannot appear in the same package, they can appear in different packages.
  • You can name them anything you wish too, but Sun has published some naming conventions that you should use when naming packages.
  • Example.
    • com.mydomain
    • net.example
    • in.domain.myblog

The line
    public class HelloWorld

The word "public" is the access specifier/modifier in java, it means access level modifiers determine whether other classes can use a particular field or invoke a particular method.

Let's what are the access specifier available in Java?
there are 4 access modifier in Java
  1. public
  2. protected
  3. no modifier - means we wont specify any modifier sometime call it default
  4. private
The scope access specifier is mentioned in the below tabular form.



The word "class" in the second line, everything in java wrapped under the class. Class in java is blueprint of object and describes behavior of object.

The word "HelloWorld"

<in progess>



Java - History and Evolution

Knowing the history and evolution is very important for any language. Lets look at the Java history and its evolution. Java was started a pr...