|
Java Question only
Java Interview Questions and Answers (part 3)
(Continued from previous question...)
Java Question only
- What are the differences between a List and a Set?
- What are value objects and how are they used with EJBs?
- How do you code a Singleton in Java?
- Diffrence between JRE And JVM AND JDK
- What's a dynamic proxy class?
- When should you call SwingUtilities.invokeLater()?
- What are the differences between a Session Bean and an Entity Bean?
- How do you read an XML file in Java?
- Give an example of the Decorator pattern in the Java API.
- Difference between an abstract class and interface
- Inner classes
- Difference between an inner class and a normal class
- What is Entity Bean and Session Bean ?
- What are the methods of Entity Bean?
- How does Stateful Session bean store its state ?
- Why does Stateless Session bean not store its state even though it has ejbActivate and ejbPassivate ?
- What are the services provided by the container ?
- Types of transaction ?
- What is bean managed transaction ?
- Why does EJB needs two interface( Home and Remote Interface) ?
- What are transaction attributes ?
- What is the difference between Container managed persistent bean and Bean managed persistent entity bean ?
- What is J2EE ?
- What is JTS ?
- How many entity beans used and how many tables can u use in EJB project ?
- What is scalable,portability in J2EE?
- What is Connection pooling?Is it advantageous?
- Method and class used for Connection pooling ?
- How to deploy in J2EE(i.e Jar,War file) ?
- How is entity bean created using Container managed entity bean ?
- Sotware architechture of EJB ?
- In Entity bean will the create method in EJB home and ejbCreate in Entity bean have the same parameters ?
- What methods do u use in Servlet - Applet communication ?
- What are the types of Servlet ?
- Difference between HttpServlet and Generic Servlets ?
- Difference between doGet and doPost ?
- What are the methods in HttpServlet?
- What are the types of SessionTracking?
- What is Cookie ? Why is Cookie used ?
- If my browser does not support Cookie,and my server sends a cookie instance What will happen ?
- Why do u use Session Tracking in HttpServlet ?
- Can u use javaScript in Servlets ?
- What is the capacity the doGet can send to the server ?
- What are the type of protocols used in HttpServlet ?
- Difference between TCP/IP and IP protocol ?
- Why do you use UniCastRemoteObject in RMI ?
- How many interfaces are used in RMI?
- Can Rmi registry be written in the code, without having to write it in the command prompt and if yes where?
- Why is Socket used ?
- What are the types of JDBC drivers ?
- Explain the third driver(Native protocol driver) ?
- Which among the four driver is pure Java driver ?
- What are the Isolation level in JDBC transaction ?
- How do you connect with the database ?
- How do you connect without the Class.forName (" ") ?
- What does Class.forName return ?
- What are the types of statement ?
- Why is preparedStatement,CallableStatement used for?
- In real time project which driver did u use ?
- Difference between AWT and Swing compenents ?
- Is there any heavy weight component in Swings ?
- Can the Swing application if you upload in net, be compatible with your browser?
- What should you do get your browser compatible with swing components?
- What are the methods in Applet ?
- When is init(),start() called ?
- When you navigate from one applet to another what are the methods called ?
- What is the difference between Trusted and Untrusted Applet ?
- What is Exception ?
- What are the ways you can handle exception ?
- When is try,catch block used ?
- What is finally method in Exceptions ?
- What are the types of access modifiers ?
- What is protected and friendly ?
- What are the other modifiers ?
- Is synchronised modifier ?
- What is meant by polymorphism ?
- What is inheritance ?
- What is method Overloading ? What is this in OOPS ?
- What is method Overriding ? What is it in OOPS ?
- Does java support multi dimensional arrays ?
- Is multiple inheritance used in Java ?
- How do you send a message to the browser in JavaScript ?
- Does javascript support multidimensional arrays ?
- Why is XML used mainly?
- Do use coding for database connectivity in XML?
- What is DTD ?
- Is there any tool in java that can create reports ?
- Explain protected vs private vs public data members and methods?
- Explain overloading and overriding?
- What is polymorphism?
- What is inheritance?
- What is encapsulation?
- Give an example of where you might use a static method?
- Explain up casting and down casting?
- What is an abstract class?
- Explain multiple inheritance and interfaces?
- If you have a tree of derived classes, what order are the constructors run
- How do you deal with errors?
- What is a ClassLoader?
- How are ClassLoaders used, when and why?
- What is a fully qualified class name?
- What is the classpath, and how does it relate to classloaders?
- When does the JVM invoke a classloader?
- When invoked, how does a classloader handle the loading of a class?
- Can you pass classes between classloader, why/whynot?
- What is a ClassDefNotFoundError?
- What is a ClassCastException?
- What is a CircularityError?
- How are classes stored in the JVM?
- Can CORBA be integrated with XML?
- can I make my site completely safe by running the server in a "chroot" envirinment?
- Whats the "chroot" environment?
- How can I detect if my site's been broken into?
- what types of access restrictions are avilable?
- Isn't there a CGI Script to allow users to change their passwords online?
- What are: SSL, SHTTP, Shen? and Cybercash, SET and Open Market?
- Are there any "freeware" secure services?
- Can I use Personal Certificates to control server access?
- What are Perl taint checks? How do I turn them On?
- How do I untaint a variable?
- How can you push data from an Applet to Servlet ?
- How you can know about drivers and database information ?
- If you are truncated using JDBC, How can you know ..that how much data is truncated ?
- And What situation , each of the 4 drivers used ?
- In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
Suppose server object is not loaded into the memory, and the client request for it , what will happen?
- Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
- What is difference RMI registry and OSAgent ?
- What is the corresponding Layout for Card in Swing ?
- What is light weight component ?
- Can you run the product development on all operating systems ?
- What is difference in between Java Class and Bean ?
- Can we send object using Sockets ?
- How to communicate 2 threads each other ?
- What are the files generated after using IDL to Java Compilet ?
- Can I modify an object in CORBA ?
- What is the functionality stubs and skeletons ?
- What is the mapping mechanism used by Java to identify IDL language ?
- Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
- In servlets, we are having a web page that is invoking servlets username and password ? which is cheks in the database ? Suppose the second page also If we want to verify the same information whethe it will connect to the database or it will be used previous information?
- What are session variable in Servlets ?
- How will you pass parameters in RMI ? Why u serialize?
- What is the exact difference in between Unicast and Multicast object ? Where we will use ?
- What is the main functionality of the Remote Reference Layer ?
- How do you download stubs from a Remote place ?
- I want to store more than 10 objects in a remote server ? Which methodology will follow ?
What is meant by Session ? Tell me something about HTTPSession Class ?
- Have you used threads in Servelet ?
- How do you sing an Applet ?
- In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
- Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
- Tell me the latest versions in JAVA related areas ?
- What is meant by class loader ? How many types are there? When will we use them ?
- How do you load an Image in a Servlet ?
- What is meant by flickering ?
- What is meant by distributed Application ? Why we are using that in our applications ?
- What is the functionality of the stub ?
- What is the latest version of JDBC ? What are the new features are added in that ?
- What is the role of the webserver ?
- What is meant by cookies ? Explain ?
- How OOPS concept is achieved in Java
- How does Java 2.0 differ from Java 1.0
- What are command line arguments
- Wrapper class. Is String a Wrapper Class
- What are the restriction for static method
- Purpose of the file class
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
|