Use the Externalizable interface when you need complete control over your Bean's serialization (for example, when writing and reading a specific file format).
Java Interview Questions and Answers (part 3)
(Continued from previous question...)
407. Use the Externalizable interface when you need complete control over your Bean's serialization (for example, when writing and reading a specific file format).
No. Earlier order is maintained.
(Continued on next question...)
Other Interview Questions
- Why isn't there operator overloading?
- What does it mean that a method or field is "static"?
- Why do threads block on I/O?
- What is synchronization and why is it important?
- Is null a keyword?
- Which characters may be used as the second character of an identifier,but not as the first character of an identifier?
- Whats the difference between notify() and notifyAll()?
- Why can't I say just abs() or sin() instead of Math.abs() and Math.sin()?
- Why are there no global variables in Java?
- What does it mean that a class or member is final?
- What does it mean that a method or class is abstract?
- What is the main difference between Java platform and other platforms?
- What is the Java Virtual Machine?
- What is the Java API?
- What is the package?
- What is native code?
- Explain the user defined Exceptions?
- Is Java code slower than native code?
- Can main() method be overloaded?
- What is the serialization?
- Explain the new Features of JDBC 2.0 Core API?
- Explain garbage collection?
- How you can force the garbage collection?
- What is OOPS?
- Describe the principles of OOPS.
- Explain the Encapsulation principle.
- Explain the Inheritance principle.
- Explain the Polymorphism principle.
- Explain the different forms of Polymorphism.
- What are Access Specifiers available in Java?
- Describe the wrapper classes in Java.
- What is the result in program? <
- The superclass constructor runs before the subclass constructor ...
- Why are the interfaces more flexible than abstract classes?
- What are new language features in J2SE 5.0?
- What is covariant return type?
- What is the result of the following statement?
- What is externalization? Where is it useful??
- Use the Externalizable interface when you need complete control over your Bean's serialization (for example, when writing and reading a specific file format).
- What will be the output on executing the following code ..
- What will be the output on executing the following code...
- What is a marker interface ?
- What are tag interfaces?
- What are the restrictions placed on static method ?
- What is JVM?
- What is JIT?
- What are ClassLoaders?
- What is Service Locator pattern?
- What is Session Facade pattern?
- What is Data Access Object pattern?
- How can we make a class Singleton
- Can we make an EJB singleton?
- How is static Synchronization different form non-static synchronization?
- What are class members and Instance members?
- Name few Garbage collection algorithms?
- Does Java pass by Value or reference?
- Why Thread is faster compare to process?
- When and How is an object considered as Garbage by a GC?
- Can we force Garbage collection?
- What are generations in Garbage Collection terminolgy? What is its relevance?
- What is a Throughput Collector?
- When to Use the Throughput Collector?
- What is AggressiveHeap?
- What is a Concurrent Low Pause Collector?
- When to Use the Concurrent Low Pause Collector?
- What is Incremental Low Pause Collector?
- When to Use the Incremental Low Pause Collector?
- How do you enable the concurrent garbage collector on Sun's JVM?
- What is a platform?
- What is transient variable?
- How to make a class or a bean serializable?
- What restrictions are placed on method overloading?
- Name Container classes.
- What is the List interface?
- What is the difference between a Scrollbar and a ScrollPane?
- What is tunnelling?
- What is meant by "Abstract Interface"?
- Can Java code be compiled to machine dependent executable file?
- Do not use the String contatenation operator in lengthy loops or other places where performance could suffer. Is that true?
- What method is used to specify a container's layout?
- Which containers use a FlowLayout as their default layout?
- What state does a thread enter when it terminates its processing?
- What is the Collections API?
- What is the List interface?
- Is sizeof a keyword?
- Which class is the superclass for every class.
- Which Container method is used to cause a container to be laid out and redisplayed?
- What's the difference between a queue and a stack?
- 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?
- What comes to mind when you hear about a young generation in Java?
- What comes to mind when someone mentions a shallow copy in Java?
- If you're overriding the method equals() of an object, which other method you might also consider?
- You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: ArrayList or LinkedList?
- How would you make a copy of an entire Java object with its state?
- How can you minimize the need of garbage collection and make the memory use more effective?
- There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?
- What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?
- What is the difference between an Interface and an Abstract class?
- What is the purpose of garbage collection in Java, and when is it used?
- Describe synchronization in respect to multithreading.
- Explain different way of using thread?
- What are pass by reference and passby value?
- What is HashMap and Map?
- Difference between HashMap and HashTable?
- Difference between Vector and ArrayList?
- Difference between Swing and Awt?
- 470. What is the difference between a constructor and a method?
- What is an Iterator?
- 472. State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
- What is an abstract class?
- What is static in java?
- What is final?
- What if the main method is declared as private?
- What if the static modifier is removed from the signature of the main method?
- What if I write static public void instead of public static void?
- What if I do not provide the String array as the argument to the method?
- What is the first argument of the String array in main method?
- If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?
- How can one prove that the array is not null but empty using one line of code?
- What environment variables do I need to set on my machine in order to be able to run Java programs?
- Can an application have multiple classes having main method?
- 485. Can I have multiple main methods in the same class?
- Do I need to import java.lang package any time? Why ?
- Can I import same package/class twice? Will the JVM load the package twice at runtime?
- What are Checked and UnChecked Exception?
- What is Overriding?
- What are different types of inner classes?
- Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?
- Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?
- What is the difference between declaring a variable and defining a variable?
- What is the default value of an object reference declared as an instance variable?
- Can a top level class be private or protected?
- What type of parameter passing does Java support?
- Primitive data types are passed by reference or pass by value?
- Objects are passed by value or by reference?
- What is serialization?
- How do I serialize an object to a file?
- Which methods of Serializable interface should I implement?
- How can I customize the seralization process? i.e. how can one have a control over the serialization process?
- What is the common usage of serialization?
- What is Externalizable interface?
- When you serialize an object, what happens to the object references included in the object?
- What one should take care of while serializing the object?
- 507. What happens to the static fields of a class during serialization?
- 508. Does Java provide any construct to find out the size of an object?
- Give a simplest way to find out the time a method takes for execution without using any profiling tool?
- What are wrapper classes?
- 511. Why do we need wrapper classes?
- 512. What are checked exceptions?
- What are runtime exceptions?
- What is the difference between error and an exception?
- How to create custom exceptions?
- If I want an object of my class to be thrown as an exception object, what should I do?
- If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object?
- How does an exception permeate through the code?
- What are the different ways to handle exceptions?
- 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?
- Is it necessary that each try block must be followed by a catch block?
- If I write return at the end of the try block, will the finally block still execute?
- If I write System.exit (0); at the end of the try block, will the finally block still execute?
- 524. How are Observer and Observable used?
- What is synchronization and why is it important?
- How does Java handle integer overflows and underflows?
- Does garbage collection guarantee that a program will not run out of memory?
- What is the difference between preemptive scheduling and time slicing?
- When a thread is created and started, what is its initial state?
- 530. What is the purpose of finalization?
- What is the Locale class?
- What is the difference between a while statement and a do statement?
- WWhat is the difference between static and non-static variables?
- How are this() and super() used with constructors?
- What are synchronized methods and synchronized statements?
- What is daemon thread and which method is used to create the daemon thread?
- Can applets communicate with each other?
- What are the steps in the JDBC connection?
- How does a try statement determine which catch clause should be used to handle an exception?
- Can an unreachable object become reachable again?
- What method must be implemented by all threads?
- What are synchronized methods and synchronized statements?
- What is Externalizable?
- What modifiers are allowed for methods in an Interface?
- What are some alternatives to inheritance?
- What does it mean that a method or field is "static"?
- What is the difference between preemptive scheduling and time slicing?
- What is the catch or declare rule for method declarations?
- Is Empty .java file a valid source file?
- Can a .java file contain more than one java classes?
- Is String a primitive data type in Java?
- Is main a keyword in Java?
- Is next a keyword in Java?
- Is delete a keyword in Java?
- Is exit a keyword in Java?
- What happens if you dont initialize an instance variable of any of the primitive types in Java?
- What will be the initial value of an object reference which is defined as an instance variable?
- What are the different scopes for Java variables?
- What is the default value of the local variables?
- How many objects are created in the following piece of code? MyClass c1, c2, c3; c1 = new MyClass (); c3 = new MyClass ();
- Can a public class MyClass be defined in a source file named YourClass.java?
- Can main method be declared final?
- What will be the output of the following statement? System.out.println ("1" + 3);
- 562. What will be the default values of all the elements of an array defined as an instance variable?
- Java Question only
|