Java -a programming language used for desktop application, web application and m

Posted by Gyan Guide on February 8th, 2017

Java is general purpose programming language, that is concurrent, class-based and object oriented. Its intention is to let application developers "write once, run anywhere" (WORA), meaning that compiled Java code can be run on all platform without recompile it.

Java language project initiated by the James Gosling, Mike Sheridan, and Patrick Naughton in June 1991. It was initially called as Oak. Sun Microsystems released the first public implementation as Java 1.0 in 1995. In 1995, After that Oak was renamed as "Java" Java was originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) .There are many versions that have been released, Current stable release of Java is Java SE 8.

Java has many features like simple, object oriented, portable, platform-independent, secured, multithreaded and robust.

Java main feature is that it is object oriented means we compile our software as a combination of different types of objects that incorporates both state and behavior.

Object –oriented programming (OOPs) is a methodology that simplifies software development and makBasic concepts of OOPs are: Object, Class, Inheritance, Polymorphism, Abstraction, and Encapsulation.

Object is nothing but an instance of class .Where as class is a blue print from which objects are created, in which it captures the state and behavior of an object. For example Employee is a class, Employee “A” is the name of employee and “A” is working in depart no.10 that mean “A” is state of employee and he is ” working “ is the behavior of the employee.

Inheritance means acquiring the properties of one class inside another class .In inheritance we are using the concepts of sub and super class. Sub class (derived class, inheriting class) has the ability to inherit the super class features .for inheriting super class features sub class uses one keyword “extend”. If across the classes some common functionality is there then we make one super class and push the common functionality in there and Sub classes inherit the super class. Through this we achieve the code optimization and maintenance will be easy.

Polymorphism, it consists of two words poly and morphism .Poly means many and morphism means behavior. Polymorphism is an ability of an object to take on different forms. For example Wikipedia is an application ,if we are choosing English language then application will be showing in English ,if hindi then same application will be in hindi ,that behavior is known as polymorphism,because application is one,having different-different behavior.

Abstraction means hiding the method implementation and exposing the method signature. For getting abstraction we use one keyword ,abstract. If the class is containing abstract method that mean class should be abstract. Abstract class contains abstract(incomplete)method and concrete(complete)method,but all abstract method should be implement by a companion class. If class is not implementing all abstract method then declare it as abstract.

Encapsulation means wrapping the code and data into a single unit or hiding the data members with in the class is known as encapsulation. For achieving encapsulation data members should be private because private data members can’t be access out side the class. If we want to access the private members outside the class then we use getters and setters method. If the data members are static then getters and setters should be static ,if data members are non static then getters and setters should be non static.

 

Author : Author : GyanGuide is a software training institute,that provides training on different technologies.Free demo classes and placement assistance will be provided.Contact 080-60505064 for more details visit our website :http://gyanguide.com/bangalore-marathahalli-corejava-training

 

Like it? Share it!


Gyan Guide

About the Author

Gyan Guide
Joined: February 8th, 2017
Articles Posted: 35

More by this author