Académique Documents
Professionnel Documents
Culture Documents
Explain the purpose of the executable files that have an extra _g at the end of their names, e.g. java_g. If Java is platform independent, why doesn't it run on all platforms? Explain how to access native operating system calls from my Java program. How do we create and use sockets in Java? Explain how to send data from my Java program to a CGI program. Explain the difference between a URL instance and a URLConnection instance. How do I read a line of input at a time in Java? Why is thread synchronization important for multithreaded programs? Explain how to create a thread and start it running. When should we use an event adapter class? Explain the component and container classes. What is the difference between a runtime exception and a plain exception? Can you explain in brief life cycle for stateless and stateful beans? What is Passivation and Activation in EJB? How do we implement caching in JSP? Explain the different Authentication options available in Servlets. How can we use beans in JSP? Explain the difference between JavaBeans and taglib directives. Explain the different scopes an object can have in a JSP page. Explain the use of Externalization interface. Explain widening conversion and Narrowing conversion. How do we implement deep cloning? Explain the difference between StringBuilder and StringBuffer class. What is a StringBuffer class and how does it differ from String Class? What is MAP and SortedMap interface? Difference between static and dynamic class loading. What is Bootstrap,Extension and System Class Loader? Can you explain the directory structure for a Struts folder in brief? What are action and action form classes in Struts? How does the native language C or C++ understand data types in JAVA? Explain Exception handling in JNI. What are the advantages and disadvantages of using JNI? Explain the difference between ServletsContext and ServletConfig. Why is HTTP protocol called as a stateless protocol? Can you explain the relation between class and object? Explain with an example What is the difference between throw and throws clause, explain programmatically What is meant by Tomcat in java and its usage? Difference between Tomcat and Weblogic server. What is an interface and how will you go about implementing an interface? Explain the difference between Static and Non-Static fields of a class. What are Class loaders? Explain the types of class loader, i.e. Bootstrap Class loader, Extension Class loader and System Class loader Can you explain how can we practically do dynamic loading?
Explain how to implement Shallow Cloning. Explain how to implement Deep Cloning. Can you explain how Scheduling and Priority works in threads? Explain how to implement single threaded model in servlets. Can you explain how Java interacts with database? Explain the different section of JDBC and their usage. Can you explain SQLException class? What is SQL State in SQL Exception Can you explain CallableStatement interface in details? Explain how to do batch updates using CallableStatement interface. Explain the architecture of a Servet package. Explain different Authentication Options available in Servets. Can you explain JDBCRealm?
Simple, Object-Oriented, Robust, Distributed, Portable, Interpreted, Multithreaded, Platform Independent, Secure........... Read answer
Java program execution
What is JVM? Explain its roles and functions. Explain why Java is called as Platform independent language. Explain how Java executable executes on any platform where JVM is available................... Read answer
Java architecture
Java programming language, Java class file format, Java Application Programming Interface, Java virtual machine............. Read answer
Java class
Explain the features of Java class. Explain Fields, Methods, and Access Levels. What are accessors and mutator methods in a Java class? Explain with example for each. Explain the importance of 'this' reference. Write a code to depicts the use of 'this' reference Explain static variables and static methods in Java. Provide an example to explain them.................. Read answer
Java constructors
What is a constructor? Explain the differences between methods and constructor. Differences between constructors and methods. Write code to depict the use of constructor..................... Read answer
Java class member
What is instance members? Explain with an example What is instance variable? Explain with an example What is instance method? Explain with an example What is static member? Explain with an example What is static variable? Explain with an example...................... Read answer
Java packages
What are Java packages? Explain the importance of Java packages. Steps for creating a package in Java Explain the packages access specifier, i.e. private, protected, public, default............. Read answer
Java garbage collector
Explain Java Garbage collector. Why garbage collection? Brief explanation of Garbage collection algorithms. Explain the importance of finalizers in Java. Write code to depict the uses of finalizers in Java............... Read answer
Java super keyword
Explain the importance of 'super' keyword in Java. Write code to depict the uses of 'super' keyword - The keyword super is used for referring parent class instance.................... Read answer
Java overloading & overriding
Define Method overloading. Explain its uses. Provide a code sample to explain the uses of Method overloading Define Method overriding. Explain its uses. Provide a code sample to explain the uses of Method overloading Difference between overloading and overriding....................... Read answer
Java string class
Describe Java string class. Explain methods of Java string class. Explain the characteristics of StringBuffer class - String Class: The String class is immutable, The contents of the String object can not be changed, String class is final class. That implies it can not have sub classes...................... Read answer
Java inner classes
What is Java inner class? Explain the types of inner classes, i.e. Static member classes, Member classes, Local classes, Anonymous classes Need of inner class in context with adapter classes Explain few Wrapper Classes Methods............... Read answer
Java reflection class
Explain about Java reflection class. Write a code sample to depict the uses of Java reflection class......... Read answer
Java swing
What is Swing? Explain the need of Swing. Write some important features of Swing. Describe Java Swing class hierarchy. Explain the need of Layout manager........... Read answer
Java layout manager
Explain different layout manager in Java. - A layout manager organizes the objects in a container, Different layouts are used to organize or to arrange objects............. Read answer
Java exception handling
Explain the need of Exception handling. Explain the Exceptions categories, i.e. checked and unchecked exceptions. Provide the general form of Exception handling constructs with explanation What is user defined Exception? Explain with an example............ Read answer
Java multithreading
What is Multithreading? Explain the life cycle of a thread. Explain how to use thread class for Multithreading in Java. Explain with an example. What is Runnable interface? Explain how to use Runnable interface for Multithreading.
What are the methods of thread class in java? Explain them Can your explain thread priorities?.............. Read answer
Java file handling
Explain the use of Streams. Difference between Stream classes and Reader writer classes Explain and demonstrate the use of File, RandomAccessFile classes. Explain the use of Reader and Writer classes.............. Read answer
Java utility classes
What is object Serialization? Explain the use of Persisting object. Depict the step of using object Deserialization..................... Read answer
Java socket programming
What is socket? Explain the features of socket. Explain the characteristics of Java socket class. Explain ServerSocket class with an example Explain InetAddress class with an example Explain DatagramSocket class with an example Explain DatagramPacket class with an example............. Read answer
JDBC
Purposes of JDBC API Describe 4 types of JDBC drivers and their characteristics with usages. State the functionalities of important classes in JDBC packages. Explain how to use JDBC statement to execute SQL queries. Show in an example Explain how to use Prepared Statement to execute parameterized queries. Show in an example What is JDBC Callable Statement? What is batch updates in JDBC? Explain with an example...................... Read answer
What is synchronization?
Synchronization ensures only one thread to access a shared resource, thus controls the access of multiple threads to shared resources.
What is serialization?
Serialization helps to convert the state of an object into a byte stream.
Objects are serialized when need to be sent over network. They are serialized when the state of an object is to be saved.
The File class provides access to the files and directories of a local file system.
What is a Class?
A class implements the behavior of member objects by describing all the attributes of objects and the methods.
What is an Object?
An object is the members of a class. It is the basic unit of a system. It has attributes, behavior and identity.
What is an exception?
An exception is an abnormal condition that arises in a code sequence at run time
thread.stop;
What is a JVM?
JVM is Java Virtual Machine which is a run time environment for the compiled java class files.
The Java native method is used to merge the power of C or C++ programming into Java. To enhance to high performance language, when efficient native Java compilers are not fully implemented, use of native method boosts the performance to at least the speed of C compiled code.
Java applications can call code written in C, C++, or assembler. This is sometimes done for performance and sometimes to access the underlying host operating system or GUI API using the JNI.
The class loader describes the behavior of converting a named class into the bits responsible for implementing that class. Class loaders eradicate the JREs need to know anything about files and file systems when running Java programs. A class loader creates a flat name space of class bodies that are referenced by a string name and are written as: Class r = loadClass(String className, boolean resolveIt);
The Reflection API allows Java code to examine classes and objects at run time. The new reflection classes allow you to call another class's methods dynamically at run time. With the reflection classes, you can also examine an instance's fields and change the fields' contents. It is also possible to instantiate new objects, invoke methods and get/set field values using reflection. The Reflection API consists of the java.lang.Class class and the java.lang.reflect classes: Field, Method, Constructor, Array, and Modifier.
The static class loading is done through the new operator. Dynamic class loading is achieved through Run time type identification. Also called as reflection
This is done with the help of the following methods: getClass(); getName(); getDeclaredFields(); Instance can also be created using forName() method. It loads the class into the current class memory.
Deep cloning - You clone the object and their constituent parts.
It should be used when it is inappropriate to separate the parts; the object is formed of, from it. Shallow cloning - You clone only the object, not their parts. You add references to their parts. It should be used when it is adequate to have the references added to the cloned object
Comparators can be used to control the order of certain data structures and collection of objects too. The interface can be found in java.util.Comparator A Comparator must define a compare function which takes two Objects and returns a -1, 0, or 1 Sorting can be done implicitly by using data structures of by implementing sort methods explicitly.
Private Constructors can't be access from any derived classes neither from another class. So you have to provide a public function that calls the private constructor if the object has not been initialized, or you have to return an instance to the object, if it was initialized.
Because it is executed automatically when the class is loaded, parameters don't make any sense, so a static initializer block doesn't have an argument list.
The Externizable interface extends the serializable interface. When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject()two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class's serialization process. The two methods to be implemented are : void readExternal(ObjectInput) The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. void writeExternal(ObjectOutput) The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
When the only remaining threads in a process are daemon threads, the interpreter exits. This makes sense because when only daemon threads remain, there is no other thread for which a daemon thread can provide a service. You cannot create a daemon method but you can use public final void setDaemon(boolean isDaemon) method to turn it into one.
Multithreading occurs asynchronously, meaning one thread executes independently of the other threads. In this way, threads dont depend on each others execution. In contrast, processes that run synchronously depend on each other. That is, one process waits until the other process terminates before it can execute