Scanner Class in java to get user input | java.util.Scanner

The Scanner class is part of the java.util class library. and it is used to get user input java.util.Scanner java.util.Scanner is a class in the Java API used to create a Scanner object, an extremely versatile object that you can use to input alphanumeric characters from several input sources and convert them to binary data. … Read more

Polymorphism in Java

Polymorphism in Java is a concept by which we can perform a single action in different ways. Polymorphism is derived from 2 Greek words: poly and morphs. The word “poly” means many and “morphs” means forms. So polymorphism means many forms. There are two types of polymorphism in Java compile–time polymorphism runtime polymorphism Compile-time polymorphism … Read more

Interface in Java

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. Java Interface also represents … Read more

Abstract class in Java

A class that is declared with abstract keyword, is known as abstract class in java. It can have abstract and non–abstract methods (method with body) Abstraction in Java Abstraction is a process of hiding the implementation details and showing only functionality to the user Abstraction lets you focus on what the object does instead of … Read more

Inheritance in java

Inheritance in java is a relationship between a superclass: a more generalized class A subclass: a more specialized class The subclass ‘inherits’ data (variables) and behavior (methods) from the superclass Important facts about inheritance in Java Default superclass: Except Object class, which has no superclass, every class has one and only one direct superclass (single … Read more

Java Package

Packages in java are those class which contains methods without the main method in them. Packages are mainly used to reuse the classes which are already created/used in other program We can define many number of classes in the same package Packages are mainly divided into two types Built in packages User defined Packages The … Read more