Skip to main content

Posts

Showing posts with the label Java

Interface in Java

Introduction        An interface in Java is a blueprint of a class. It has static constants and abstract methods. The interface in Java is a mechanism to achieve abstraction. There can be only abstract methods in the Java interface, not method body. It is used to achieve abstraction and multiple inheritance in Java. In other words, you can say that interfaces can have abstract methods and variables. It cannot have a method body. Java Interface also represents the IS-A relationship.      It cannot be instantiated just like the abstract class. Since Java 8, we can have default and static methods in an interface. Since Java 9, we can have private methods in an interface. There are mainly three reasons to use interface. They are given below 👉 It is used to achieve abstraction. 👉 By interface, we can support the functionality of multiple inheritance. 👉 It can be used to achieve loose coupling. Declaration of interface: An interface is declared by using t...

Features Of Java

 Features Of Java The main objective of Java Programing was to make it portable, simple and secur programming language. The features of java language is as below. 1. Simple:        Java is very easy to learn and syntax is simple, clean and easy to understand. Java syntax is base on C++ so easier for programmers to learn it after C++. Java has removed many complicated and rarely use features for example, explicit pointer, operator overloading etc. In java, there is no need to remove unreferenced object because there is Automatic Garbage Collection in java. 2. Object Oriented:     In java the data and methods can flow in the form of object so it is call Object-oriented programing language. Object oriented programming is a methodology that simplifies software development and maintain by providing some rules. The basic concepts of OOPS are:     Object     Class     Inheritance     Ploymorphism     Abstract...

Introduction of Java

 What is Java? Java is an object-oriented programming language developed by Sun Microsystem in 1995. It is a combination of C and C++ features with some essential and additional concepts. Java is suited for both standalone and web application development. Java can run on any hardware OR software environment which make it platform independent. Java Example:                                                                                           class Simple{     public static void main(String args[]){          System.out.println("Welcome In Java World");     } } In above example the 'Simple' is a Class name, public is access specifier , Main is a method with argument, St...