Data Structure
 Networking
 RDBMS
 Operating System
 Java
 MS Excel
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP
- Selected Reading
 - UPSC IAS Exams Notes
 - Developer's Best Practices
 - Questions and Answers
 - Effective Resume Writing
 - HR Interview Questions
 - Computer Glossary
 - Who is Who
 
Java Articles - Page 681 of 745
 
			
			656 Views
Before the release of Java version 8, the interface consists of only abstract methods and variables that defines the behavior that a class could implement. While adding a new method to an interface, it required change in all the implementing classes. It was not convenient for a large application. To overcome this, Java 8 introduced default and static methods in interfaces. In Java, an Interface is a type of class that is defined using the keyword interface and has only method bodies without any implementations. To access its members within a class, we need to use the implements keyword while ... Read More
 
			
			656 Views
Before the release of Java version 8, the interface consists of only abstract methods and variables that defines the behavior that a class could implement. While adding a new method to an interface, it required change in all the implementing classes. It was not convenient for a large application. To overcome this, Java 8 introduced default and static methods in interfaces. In Java, an Interface is a type of class that is defined using the keyword interface and has only method bodies without any implementations. To access its members within a class, we need to use the implements keyword while ... Read More
 
			
			1K+ Views
Encapsulation Encapsulation is one of the four fundamental OOPs concepts. The other three are inheritance, polymorphism, and abstraction.Encapsulation in Java is a mechanism for wrapping the data (variables) and the code acting on the data (methods) together as a single unit. In encapsulation, the variables and methods within a class are hidden using the private access specifier (though it's not mandatory for all variables and methods to be private). This is known as data hiding.To access private variables and methods from other classes, one of the simplest ways is by using getter and setter methods. ... Read More
 
			
			458 Views
What is Downcasting? Typecasting an object of the parent class to an object of the child class is called Downcasting in Java. We need to tell the Java compiler to perform the conversion explicitly by creating an object of the child type using a reference of the parent type. It is the opposite of upcasting, where a subclass reference is converted into a superclass reference automatically by the compiler. Typecasting is a process in which one data type or object is converted into another. It works with primitive datatypes and reference types as well. In this article, we are going ... Read More
 
			
			458 Views
What is Downcasting? Typecasting an object of the parent class to an object of the child class is called Downcasting in Java. We need to tell the Java compiler to perform the conversion explicitly by creating an object of the child type using a reference of the parent type. It is the opposite of upcasting, where a subclass reference is converted into a superclass reference automatically by the compiler. Typecasting is a process in which one data type or object is converted into another. It works with primitive datatypes and reference types as well. In this article, we are going ... Read More
 
			
			458 Views
What is Downcasting? Typecasting an object of the parent class to an object of the child class is called Downcasting in Java. We need to tell the Java compiler to perform the conversion explicitly by creating an object of the child type using a reference of the parent type. It is the opposite of upcasting, where a subclass reference is converted into a superclass reference automatically by the compiler. Typecasting is a process in which one data type or object is converted into another. It works with primitive datatypes and reference types as well. In this article, we are going ... Read More
 
			
			3K+ Views
In Java, multilevel inheritance allows a class to inherit attributes and methods from another class by creating a multiple layer of inheritance. Runtime polymorphism lets a child class to provide different implementations of inherited methods through method overriding. When we implement runtime polymorphism using multilevel inheritance, call to the overridden method is decided at the run time by JVM on the basis of object type. In this article, we are going to demonstrate runtime polymorphism in Java using multilevel inheritance. But, let's discuss runtime polymorphism first. What is Runtime Polymorphism in Java? Runtime polymorphism is a type of polymorphism ... Read More
 
			
			3K+ Views
In Java, multilevel inheritance allows a class to inherit attributes and methods from another class by creating a multiple layer of inheritance. Runtime polymorphism lets a child class to provide different implementations of inherited methods through method overriding. When we implement runtime polymorphism using multilevel inheritance, call to the overridden method is decided at the run time by JVM on the basis of object type. In this article, we are going to demonstrate runtime polymorphism in Java using multilevel inheritance. But, let's discuss runtime polymorphism first. What is Runtime Polymorphism in Java? Runtime polymorphism is a type of polymorphism ... Read More
 
			
			3K+ Views
In Java, multilevel inheritance allows a class to inherit attributes and methods from another class by creating a multiple layer of inheritance. Runtime polymorphism lets a child class to provide different implementations of inherited methods through method overriding. When we implement runtime polymorphism using multilevel inheritance, call to the overridden method is decided at the run time by JVM on the basis of object type. In this article, we are going to demonstrate runtime polymorphism in Java using multilevel inheritance. But, let's discuss runtime polymorphism first. What is Runtime Polymorphism in Java? Runtime polymorphism is a type of polymorphism ... Read More
 
			
			18K+ Views
Method overriding is an example of runtime polymorphism. In method overriding, a subclass overrides a method with the same signature as that of in its superclass. During compile time, the check is made on the reference type. However, in the runtime, JVM figures out the object type and would run the method that belongs to that particular object.ExampleSee the example below to understand the concept − Live Democlass Animal { public void move() { System.out.println("Animals can move"); } } class Dog extends Animal { public void move() { System.out.println("Dogs can walk and ... Read More