<< < 18 19 20 21 22 23 24 25 26 27 > >>   Sort: Date

What is Externalizable?
What is Externalizable? Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)
2013-02-05, 1942👍, 0💬

What are the Object and Class classes used for?
What are the Object and Class classes used for? The Object class is the highest-level class in the Java class hierarchy. The Class class is used to represent the classes and interfaces that are loaded by a Java program.
2013-01-25, 1942👍, 0💬

Can an abstract class be final?
Can an abstract class be final? An abstract class may not be declared as final.
2013-01-17, 1942👍, 0💬

What restrictions are placed on method overriding?
What restrictions are placed on method overriding? Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of the method it overrides. The overriding method may not throw any exceptions that may not be thrown by the overridden method...
2013-01-14, 1942👍, 0💬

Why do we need wrapper classes?
Why do we need wrapper classes? It is sometimes easier to deal with primitives as objects. Moreover most of the collection classes store objects and not primitive data types. And also the wrapper classes provide many utility methods also. Because of these resons we need wrapper classes. And since we...
2013-05-27, 1941👍, 0💬

How to make a class or a bean serializable?
How to make a class or a bean serializable? By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface. As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable.
2013-04-01, 1941👍, 0💬

What one should take care of while serializing the object?
What one should take care of while serializing the object? One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException.
2013-05-23, 1940👍, 0💬

What is the serialization?
What is the serialization? The serialization is a kind of mechanism that makes a class or a bean persistence by having its properties or fields and state information saved and restored to and from storage.
2013-02-25, 1940👍, 0💬

Can applets communicate with each other?
Can applets communicate with each other? At this point in time applets may communicate with other applets running in the same virtual machine. If the applets are of the same class, they can communicate via shared static variables. If the applets are of different classes, then each will need a refere...
2013-06-14, 1939👍, 0💬

Can I import same package/class twice? Will the JVM load the package twice at runtime?
Can I import same package/class twice? Will the JVM load the package twice at runtime? One can import the same package or same class multiple times. Neither compiler nor JVM complains abt it. And the JVM will internally load the class only once no matter how many times you import the same class.
2013-05-09, 1938👍, 0💬

Name four Container classes.
Name four Container classes. Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane
2012-12-21, 1937👍, 0💬

Does Java pass by Value or reference?
Does Java pass by Value or reference? Its uses Reference while manipulating objects but pass by value when sending method arguments. Those who feel why I added this simple question in this section while claiming to be maintaining only strong and interesting questions, go ahead and answer following q...
2013-03-20, 1936👍, 0💬

Can we make an EJB singleton?
Can we make an EJB singleton? This is a debatable question, and for every answer we propose there can be contradictions. I propose 2 solutions fo the same. Remember that EJB's are distributed componenets and can be deployed on different JVM's in a Distributed environment i) Follow the steps as given...
2013-03-18, 1935👍, 0💬

Can there be an abstract class with no abstract methods in it?
Can there be an abstract class with no abstract methods in it? yes.
2013-02-01, 1935👍, 0💬

Can an exception be rethrown?
Can an exception be rethrown? Yes, an exception can be rethrown.
2012-12-13, 1935👍, 0💬

What is the basic difference between the 2 approaches to exception handling.
520. What is the basic difference between the 2 approaches to exception handling. 1. try catch block and 2. specifying the candidate exceptions in the throws clause? When should you use which approach? In the first approach as a programmer of the method, you urself are dealing with the exception. Th...
2013-06-03, 1934👍, 0💬

What is AggressiveHeap?
What is AggressiveHeap? The -XX:+AggressiveHeap option inspects the machine resources (size of memory and number of processors) and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. It was originally intended for machines with large amounts of memor...
2013-03-26, 1934👍, 0💬

Explain the different forms of Polymorphism
Explain the different forms of Polymorphism From a practical programming viewpoint, polymorphism exists in three distinct forms in Java: Method overloading Method overriding through inheritance Method overriding through the Java interface
2013-03-04, 1933👍, 0💬

What is the difference between error and an exception?
What is the difference between error and an exception? An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will...
2013-05-29, 1932👍, 0💬

Explain the user defined Exceptions?
Explain the user defined Exceptions? User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same ...
2013-02-22, 1932👍, 0💬

What are wrapper classes?
What are wrapper classes? Java provides specialized classes corresponding to each of the primitive data types. These are called wrapper classes. They are e.g. Integer, Character, Double etc.
2013-05-27, 1931👍, 0💬

I made my class Cloneable but I still get 'Can't access protected method clone. Why?
I made my class Cloneable but I still get 'Can't access protected method clone. Why? Yeah, some of the Java books, in particular "The Java Programming Language", imply that all you have to do in order to have your class support clone() is implement the Cloneable interface. Not so. Perhaps that was t...
2013-02-07, 1931👍, 0💬

If I want an object of my class to be thrown as an exception object, what should I do?
If I want an object of my class to be thrown as an exception object, what should I do? The class should extend from Exception class. Or you can extend your class from some more precise exception type also.
2013-05-30, 1930👍, 0💬

You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declar
You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces? Sometimes. But your class may be a descendent of another class and in this case the interface is...
2013-04-14, 1929👍, 0💬

<< < 18 19 20 21 22 23 24 25 26 27 > >>   Sort: Date