Category: J2SE Category

What is CallableStatement? 0

What is CallableStatement?

A java.sql.CallableStatement is used to call stored procedures in a database. A stored procedure is like a function or method in a class, except it lives inside the database. CallableStatement – Can be created...

What is the difference between ClassNotFoundException and NoClassDefFoundError ? 0

What is the difference between ClassNotFoundException and NoClassDefFoundError ?

ClassNotFoundException is an exception that occurs when you try to load a class at run time using Class.forName() or loadClass() methods and mentioned classes are not found in the classpath. NoClassDefFoundError is an error...

Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/transaction/SystemException 0

Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/transaction/SystemException

You dont’ have javax.transaction.SystemException on your runtime classpath. This can be fixed by adding dependency to your pom.xml if you use Maven <dependency> <groupId>javax.transaction</groupId> <artifactId>javax.transaction-api</artifactId> <version>1.2</version> </dependency> If you are using gradle, here is...

play.exceptions.JavaExecutionException: id to load is required for loading 0

play.exceptions.JavaExecutionException: id to load is required for loading

we have a null value for id in the method. It has easy search – reading the error message – reading the source code of org.hibernate.event.LoadEvent

What is the ResourceBundle class? 0

What is the ResourceBundle class?

The java.util.ResourceBundle class is used to store texts and components that are locale sensitive. ResourceBundle has the subclasses PropertiesResourceBundle and ListResourceBundle. public abstract class ResourceBundle extends Object Resource bundles contain locale-specific objects. When your...

What are the Object and Class classes used for? 0

What are the Object and Class classes used for?

Object class Object is a Superclass for all class The Object class, in the java.lang package, sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of...

Is JVM platform independent? 0

Is JVM platform independent?

The JVM must be platform dependent to allow your Java to run on the specific platform. A JVM for Windows will translate your Java into different system calls than a JVM for OS X....

What are the disadvantages of using threads? 0

What are the disadvantages of using threads?

Because threads have some of the properties of processes, they are sometimes called lightweight processes. In a process, threads allow multiple executions of streams. This is why thread needs its own stack. An operating...

What interface must an object implement before it can be written to a stream as an object? 0

What interface must an object implement before it can be written to a stream as an object?

We need to implement java.io.Serializable interface which we are willing to write to a stream as an object. Example import java.io.Serializable; public class Employee implements Serializable { Integer empId; String empName; public Integer getEmpId()...

why do you create interfaces, and when MUST you use one? 0

why do you create interfaces, and when MUST you use one?

As many people have probably already given their Idea, interfaces can be used to enforce certain behaviors between classes that will not implement those behaviors the same way. So by implementing an interface you...