hello world first java program

hello world first java program

Creating first Java project

  1.  first you need to install Eclipse IDE – can be downloaded from https://www.eclipse.org

Eclipse will look like below,

2) create a project using Eclipse IDE, and give name as “Hello world”

Java project

3) create a package as shown below

Java Package

4) create a class as below,

Java class

5) fill the package name and class name as below,

Class creation

6) now insert/write the following program , since by default package and class name appears int the code

public static void main (String [] args)
{

System.out.println(“Hellow world………………. “);
System.out.println(“this is my first progrm”);

}

now you see the package name and class name are matching with the left pan tree structure as per below email. Also notice when you execute the results are displayed below.

Java - Hello world

 

 

 

Java vs JavaScript

Java vs JavaScript

Java is an OOP programming language and written in Integrated Development Environment(IDE) like ECLIPSE however Java Script is an OOP scripting language and does not require any IDE. Java is class based but Java script is not. Java code needs compiling on IDE but JavaScript code does not. Java script is extensively used in World Wide Web apart from HTML and CSS. Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only. JavaScript uses much smaller, easier and simpler set of commands than Java. Java is more rigid and complex.

 

 

Java OOP concepts

Java OOP concepts

Object-Oriented Programming is a methodology to design a program using classes and objects. Java uses OOP.
Object – an entity that has state and behavior is known as an object
classes – Collection of objects is called class.

Polymorphism – When one task is performed by different ways or ability of an object to take on many forms.
Abstraction – Hiding internal details and showing functionality is known as abstraction.
Encapsulation – is a process of binding or wrapping the data with the code.
Inheritance – When one object acquires all the properties and behaviors of parent object. It helps on code re-usability.

JSON(JavaScript Object Notation) vs XML(extensible Markup Language)

JSON(JavaScript Object Notation) vs XML(extensible Markup Language)

JSON is more compact, readable and is an open standard format that uses human-readable text. JSON transimission is much more faster than XML. It is easy to use with Java script.
XML is a markup language is both human-readable and machine-readable, it defines a set of rules for encoding documents in a format, it is also aiming usability across Internet. XML has more data and bulky and slower than JSON.

JSON got a very simple syntax and could be easily learned. But the XML format can be determined by the XML DTD or XML Schema. JSON has the data-exchange format which is getting more popular as it is more JavaScript applications possible format.

Java Advanced definitions

Java Advanced definitions

The data structures provided by the Java utility package are the following interface and classes.

Enumeration – Enumeration interface feature is used for retrieving successive elements from a data structure.
BitSet – BitSet classes implement a group of bits or flags.
Vector – Vector class is similar to Java array however it has an ability to add new elements when required.
Stack – Stack class features ‘last in first out’ stack of elements.

Properties – Properties are subclass of Hash table. it is meant to maintain lists of values in which both key & Value are Strings.

Hashtable – Hashtable class is meant to organize data based on some user defined key structure.

Dictionary – Dictionary class is an abstract class that defines a data structure for mapping keys to values.