Category Java

Throws Keyword in Java

In Java, sometimes a method may throw an exception in a program but cannot handle it due to not have an appropriate exception handling mechanism. In such a case, the programmer has to throw that exception to the caller of…

Variables in Java

Memory representation of variables in Java

A variable in Java is a container that holds the value during the execution of Java program. In other words, a variable is the name of the memory location reserved for storing value. Each variable in Java has a specific…

Throw Keyword in Java

You will have seen earlier in all the programs of exception handling that Java runtime system (JVM) was responsible for identifying exception class, creating its object, and throwing that object. JVM automatically throws system-generated exceptions. All those exceptions are called…

Encapsulation Program in Java for Best Practice

Here, we have listed the top 5 encapsulation program in Java for the best practice with step by step explanation. These encapsulation programming questions are very important for any company interview. In the previous tutorial, we have learned about encapsulation,…

What is Abstraction in Java with Example

Realtime example of abstraction in Java

Abstraction in Java is another core OOPs principle that provides a powerful way to manage complexity. The process of hiding complex internal implementation details of a system from users and providing only necessary functionality is called abstraction. In other words,…