Core Java

If you do not want to handle the exception and let the caller of method handle it, you can achieve this by using throws keyword in java. So the caller has to either catch or throws it again. For example we have doStuff() method which throws the type Exception, so whenever any caller call this […]

There may be some situation where some java statements are not abnormal for java compiler, but the statement may generate the some abnormal conditions which are not relative to your business. So these types if conditions can be thrown in java using throw keyword of java. We can use any exception class for throw but […]

Every exception classes in java are concrete class. And all exception class has the super class as java.lang.Throwable. Please see below the block diagram of exception hierarchy of java. Throwable Java.lang.Throwable is the directly or indirectly super class of all type of errors and exception class in java. Only Objects which are instance of this class […]

What is exception handling? Whenever java programme or application runs, java runtime environment make sure it runs smoothly. Runtime environment run java application or programme correctly without any problem. But some abnormal cases the java programmes or application can get into trouble. In such type of abnormal conditions java programme can stop the execution. In […]

In java we can write a class inside the class. These types of classes called Inner classes, there are four type of inner classes which you can write in java classes. Inner class (non static) 1) In non static class we cannot declare static members like variables or methods or static block. 2) In Inner […]

Deserialization is the process of reading the object state from persistence media and put it to the memory. The persistence media must be created using Serialization process of java. Here is the example of Deserialization, the Person Object has been serialized and has been put into text.txt file now we will Deserialize this using the […]

Serialization is the process of reading the state of object from the memory and putting into persistence media like file, hard disk, database, network etc. To achieve the Serialization mechanism for object, your class must implement the Serialization or Externalizable interface. Example of Serialization: import java.io.Serializable; public class Person implements Serializable{ String name; int age; […]

String is sequence of characters. In java String is class which used widely in java programming. Java organizes the string in its own way. Java provides the java.lang.String class to deal with string. • The String is immutable class, once created and initialized, it cannot be change. • The + operator can be used for […]

In java there is no need to concentrate that where the object store and how the objects are removed if the object is no longer used. How the basic behavior of object define. The answer of all the question is Object class. The Object class is sitting at the top of class hierarchy in java […]