|
|
|
|
|
What is 1000Projects
'1000projects.com' is an educational content website dedicated to finding and realizing Final Year Projects, IEEE Projects, Engineering Projects, Science Fair Projects, Project Topics, Project Ideas, Major Projects, Mini Projects, Paper Presentations, Presentation Topics, IEEE Topics, .Net Projects, Java Projects, PHP Projects, VB Projects, SQL Projects, C & DS Projects, C++ Projects, Perl Projects, ASP Projects, Delphi Projects, HTML Projects, Cold Fusion Projects, Java Script Projects, Btech Projects, BE Projects, MCA Projects, Mtech Projects, MBA Projects, Project on Software, CBSE Projects, Testing Projects, Embedded Projects, Chemistry Projects, Electronics Projects, Electrical Projects, Science Projects, Mechanical Projects, Mba project Reports, Placement papers, Sample Resumes, Entrance Exams, Technical Faq's, Puzzles, etc
how it works?
Everything on this site is submitted by the students in this professional community. You Can submit your Projects, Project Topics & Ideas to info.1000projects{at}gmail.com after you submit your project/project Idea/Abstract/Seminar Topics, These are being verified and approved by our administrator. after approval of this project/project Idea/Abstract/Seminar Topics, It can be shown on 1000projects.com so that other users can read/discuss it.The entire content on this website is Only For Educational Purpose, Non Commercial use!
Please help us/Other Users by sending projects/project Ideas/Abstracts/Seminar Topics. Thanking You!!!!!
Category Articles
What is difference between array list and vector.? and which one is most useful.? array list does whatever vector does so why we need the array list?
Added on Tue, Dec 29, 2009
Sometimes Vector is better; sometimes ArrayList is better; sometimes you don't want to use either. I hope you weren't looking for an easy answer because the answer depends upon what you are doing. The key difference between Arrays and... Read More
Is is true that JAVA is not 100% object oriented language ?
Added on Tue, Dec 29, 2009
JAVA Interview Questions and Answers,JAVA Faqs,JAVA Interview FAQs and JAVA Books,JAVA interview ebook,JAVA technical interview questions,JAVA Quiz,JAVA Interview Paper,JAVA Placement Papers,JAVAInterview Procedure,JAVA Aptitude Questions,JAVA... Read More
Advantages of Implementing Runnable over extending Thread
Added on Wed, Dec 30, 2009
In java there is no multiple inharitence. So if we extend thread class, we can not extend some other. If we use Runnable interface. We can implements any no. of interface. Thread class is implemented from runnable interface. Runnable has only... Read More
can we write return statement in try catch or finally block.
Added on Mon, Dec 28, 2009
Question : can we write return statement in try catch or finally block. suposse we write return 0 in try catch or finally. can we do. Answers: Yes,We can write the return statement in try catch & finally. The only thing is that... Read More
How can we write our own arraylist without using collections?
Added on Tue, Dec 29, 2009
You have to use array of Object to store the element and then provide the functionality of adding,seraching and removing the element.This is the way you can create your own arrayList without using Collections. Read More
What is the difference in between the HTTPServlet and Generic Servlet. Expalin their methods. Tell me their parameter names too
Added on Wed, Dec 30, 2009
Generic Servlet class is a base class that specifies the class structure for protocol independent servlet and acts as a base for different servlets. HttpServlet is a servlet that extends Generic Servlet and is specialised to work on HTTP... Read More
What gives java it's "write once and run anywhere" nature?
Added on Tue, Dec 29, 2009
If JVM is present then it converts .java code into .class(bytecodes) hence platform independent. But not garbage collection and thread technology is platform independent Read More
Why operator overloading is not allowed in Java?
Added on Tue, Dec 29, 2009
By using the operator overload have lot of problems is there. even some time the programmer get coufused. and its increase the complexity of the program. for that purpose only its removed in java. Read More
What is the difference between main() and Main()
Added on Wed, Dec 30, 2009
Main() and Main() are two different methods in Java. But if u write Main() instead of main() then there will no exception at the compile time. But It will generate a runtime exception : java.lang.NoSuchMethodError: main Read More
IBM Interview Questions in Bangalore
Added on Mon, Dec 28, 2009
6.what is single inheritance. ans:one class is inherited by only other one class 7.what is multiple inheritance. ans:One class inheriting more than one class at atime 8.can java support multiple inheritance. ans:No 9.what is... Read More
Difference between HashMap and TreeMap
Added on Wed, Dec 30, 2009
HashMap will not store the elements in order.Whereas TreeMap stores in order.so while retrieving we will get in a particular order.But for HashMap we won't. Read More
Can you load the server object dynamically. If so, what are the major 3 steps involved in it?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why pointers are not used in java?
Added on Tue, Dec 29, 2009
The Java Language the referencing and dereferencing of objects is handled for you automatically. Java does not allow you to manipulate pointers or memory addresses of any kind. It does not allow you to cast object or array references into integers... Read More
Discuss why Java 5 Executors are the preferred mechanism of creating and dispatching work in separate threads, over either directly creating Thread objects or directly using a pool of threads?
Added on Wed, Dec 30, 2009
Most multi threaded applications involve several threads, Threads need stack and heap space, and, depending on the platform, thread creation can be expensive. In addition, cancellation and shutdown of threads can be difficult, and a well-designed and... Read More
How to create own Marker Interface with example
Added on Mon, Dec 28, 2009
Marker interface example- public interface Serializabale {} public interface Cloneable {} Also known as 'Tagging' interface Read More
What is the highest-level event class of the event-delegation model?
Added on Tue, Dec 29, 2009
The java.util.EventObject class is the highest-level class in the event-delegation class hierarchy. Read More
What is the difference between Observable and Observer
Added on Wed, Dec 30, 2009
Observer is an object that wishes to be notified when the state of other object changes.(Listener,registered with the source to be notified of any change in the source) Observable is an object whose state may be of interest and in which other... Read More
What is the difference between File and RandomFileAccess classes?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What are the differences between JIT and HotSpot
Added on Tue, Dec 29, 2009
The Hotspot VM is a collection of techniques, the most significant of which is called "adaptive optimization. The original JVMs interpreted bytecodes one at a time. Second-generation JVMs added a JIT compiler, which compiles each method to native... Read More
Why do we need interface in Java. Instead of interface we can write the methods in the class itself. Why do we need seperate interface?
Added on Tue, Dec 29, 2009
Java don't support Multiple Inheritance. For that we can use Interface. Interface is like the getway to comunicate between to classes. Not always we write methods in Interface, we can also create objects in the Interface. The Object which... Read More
want to store more than 10 objects in a remote server. Which methodology will you follow?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How do you download stubs from a Remote place?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Given A = 1, B = 2, C = 3, D = 4 ?? Z = 26, write a java standalone
Added on Tue, Dec 29, 2009
Question : Given A = 1, B = 2, C = 3, D = 4 ?? Z = 26, write a java standalone program to encode the word ?TELEPHONE? into numbers. Answers: class enCode { public static void main( String ar[]) { String enCodeWord = ... Read More
What is DatagramSocket. How will you create a connection?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why String is not a primitive data type
Added on Tue, Dec 29, 2009
The primitive datatypes are nothing but the basic data types..like int,char,float,double etc..Char is a datatype which stores 2 bits of data..String has been derived from Char which takes more number of Char and integers..providing the more memory... Read More
What is meant by class loader. How many types are there. When will we use them?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why there are some null interface in java. What does it mean. Give me some null interfaces in JAVA?
Added on Wed, Dec 30, 2009
null interfaces are nothing but marker interfaces which doesn't have any methods. The purpose is which tells to JVM for certain functionality like serializable, Cloneable etc are the examples Read More
What is cohesion and coupling in java?
Added on Tue, Dec 29, 2009
A high cohesion and low coupling is always desired. Cohesion is closely related the various functions of a class. Coupling is how closely this class is integrated with implementations of other classes, that a change in any other class will result... Read More
Is there a separate stack for each thread in Java
Added on Tue, Dec 29, 2009
Yes, there are seperate stacks. Threads share memory area, but have different stacks. http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Supplements/Chapter08/processorView.html Read More
What is the difference between a CallableStatement and PreparedStatement?
Added on Tue, Dec 29, 2009
Callable statement is that which can be called anywhere in the program. Eg:- getText() Prepared statement is that which is coded with a certain procedure and execute when the program gets executed. Read More
What is the difference between array list and linked list. in which situations we are use them? which is best one?
Added on Tue, Dec 29, 2009
public class ArrayList extends AbstractList implements List, RandomAccess, Cloneable, Serializable Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In... Read More
What is reflection API? How are they implemented
Added on Tue, Dec 29, 2009
Reflection is a feature of the Java programming language. It allows an executing Java program to examine or "introspect" upon itself, and manipulate internal properties of the program Read More
When, where and why we are using overloading and overriding???
Added on Tue, Dec 29, 2009
Overloading is resolved at compile time and overriding is resolved at run time. Read More
What is the difference between length and length() ?
Added on Mon, Dec 28, 2009
length() is function which is defined for string class whereas length is used only for array. Read More
What is the difference between transient variable,volatile variable
Added on Mon, Dec 28, 2009
Transient variable can't be serialize.A volatile variable is not allowed to have a local copy of a variable that is different from the value currently held in "main" memory. Read More
What is the main functionality of the Prepared Statement?
Added on Wed, Dec 30, 2009
PreparedStatement: Actually "PreparedStatement" is an interface in the JDBC API. The functionality of this statement is "Executing the SQL queries in the database.This statement is having the "pre-compiled code" ,so it reduces the compilation... Read More
Strings are immutable.But
Added on Wed, Dec 30, 2009
Question : Strings are immutable.But String s="Hello"; String s1=s+"World"; S.O.P(s1); means printing "HelloWorld".How ? Answers: String is immutable means that : Say s = "hello" would point to certain location , say... Read More
if two overloaded methods are-
Added on Wed, Dec 30, 2009
Question : if two overloaded methods are- Test(Object xyz) and test(Customer cust)[Assume Customer is a class with member name of type String].Now if we call test(null), which method will be called? why? ... Read More
How to use JNI in java? and what are Struts and jini?and how to apply native code in java?
Added on Wed, Dec 30, 2009
To use jni we need three things one a native library , usually a ". DLL" which is complied in C or C++. a header file for the native library and the java code whre native aPI implementation is called. a method that calls the native librbary... Read More
What is the mapping mechanism used by Java to identify IDL language?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between concat and append?
Added on Mon, Dec 28, 2009
Concat is used to add a string at the end of another string.But append() is used with String Buffer to append character sequence or string.When we concatinate a string with another string a new string object is created.But in case of StrinBuffer... Read More
What is meant by cookies? Explain.
Added on Tue, Dec 29, 2009
Cookie:Cookie is nothing but small texual peace of information send by the server .Normally cookies are used to maintain session tracking .Cookies are stored in the client machines.But all browsers does not support cookies. Submitted by... Read More
What is the difference between paint() and repaint() methods?
Added on Tue, Dec 29, 2009
A call made to repaint() method would wipe off the existing graphics on the applet and call the paint() method whereas this is not the case with calling paint() method directly. Submitted by Arun Pasuparthi (Arun_Pasuparthi@satyam.com) Read More
What is the difference between Serializalble and Externalizable interface
Added on Tue, Dec 29, 2009
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... Read More
What are the different types of Synchronization?
Added on Tue, Dec 29, 2009
Question : What are the different types of Synchronization? Is there any other way of method or class or object locking Answers: Synchronization is using two ways 1) Method Synchronization example:... Read More
What is the difference throw and throws
Added on Tue, Dec 29, 2009
Both throw and throws are keywords. throw is used to explicitly throw a user defined or predefined exception. throws is used when dont want to handle the exception and just specify that what all exceptions the method might throw. syntax : ... Read More
What is the difference between Vector, Array and Arraylist?
Added on Tue, Dec 29, 2009
1.ArrayList os not synchronized whereas the Vector is synchronized. 2.Arraylist is faster whereas Vector are slower in processing. 3. Elements in the arraylist can be traversed using Iterator interface whereas in the case of Vector we can... Read More
For a 25MHz processor , what is the time taken by the instruction which needs 3 clock cycles,
Added on Tue, Dec 29, 2009
25 MHz =25*10power(6) cycles/second i.e.for 3 clock cycles, time = 3/25MHz = 120 nano sec Read More
what is widning and narrowing ?
Added on Tue, Dec 29, 2009
Widning and Narrowing will appear in the Casting operation. Widning is nothing but converting lower datatype to higher datatype when we cast the datatypes.Narrowing is nothing but converting higher datatype to lower datatype when we cast the... Read More
Can you run the product development on all operating systems
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Explain Servlet and JSP life cycle
Added on Mon, Dec 28, 2009
Servlet Lifecycle: init() ->this initalizes the servlets initialization information with the configuration parameters. service : here the business logic starts. that is, all the request and response services goes here. destroy() : once... Read More
Explain working of Java Virtual Machine(JVM).
Added on Mon, Dec 28, 2009
JVM is an abstract computing machine like any other real computing machine which interprets the byte code( .class file which contains virtual machine instructions ) to a machine dependent native code. The output of JVM i.e the native code... Read More
What is the difference between ?overloading? and ?overriding??
Added on Tue, Dec 29, 2009
August 19th, 2009 by sd | Posted in Uncategorized<br><br>Overloading is the practice of supplying more than one definition for a given function name in the same scope. The compiler is left to pick the appropriate version of the function... Read More
Can we override Thread's run() method?
Added on Tue, Dec 29, 2009
If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns. Subclasses of Thread should override this method. Read More
Difference between "APPLET" and "APPLICATION"
Added on Tue, Dec 29, 2009
(1)Applications are must run inlocal machine where as Applets needs no explicit installation on local machine. (2)Applications mustbe run explicitly within a JVM where as Applets loads & runs itself automatically in a java-enabled browser.... Read More
Plz give me detail difference between Tomcat & Weblogic server
Added on Wed, Dec 30, 2009
SERVERS ARE TWO TYPES: 1)WEB-SERVER 2)APPILICATION SERVER. Tomcat is a web-server,this is 3-tier Architecture. where as Weblogic is an Application Server,this is n-tier Architecture.In Tomcat we cannot deploy an EJB.but in Weblogic we can.... Read More
In Execption handling What is exactly difference between throws and throw?
Added on Wed, Dec 30, 2009
Throw as well as Throws they sound similar but there is diff among them.Both of them are keywoeds used in JAVA and are related with exceptions. THROW - this keyword is used to throw an exception explicitly. -for eg consider we catch an Divide... Read More
What is meant by static query and dynamic query?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between interrupt() and join() in threads?Give an example program
Added on Wed, Dec 30, 2009
Interupt is the method on the thread to distrub or interupt on the other thread which are under execution. Where as the join method is used to say t.join() is to suspend the current thread operation for a time being and go to the other thread and... Read More
What is the difference between Grid and GridbagLayout?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between HashMap and TreeMap?
Added on Tue, Dec 29, 2009
Difference b/w the Hashmap and Treemap: Both Hashmap and Treemap are datastructures, which holds the values of in the form of key -value pairs.Both are unchronized datastructures. but difference is hashmap is a unordered datastructure,treemap is... Read More
What is JavaMail?
Added on Tue, Dec 29, 2009
The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. Submitted by Siju Kurian (siju.kurian@wipro.com) Read More
What is final class?
Added on Tue, Dec 29, 2009
Final class: Final class is class ,which should not inherited into the derived class. If a class declared as final by defaulat all methods are final not fields. You can't change the final class object. eg:String, Date, System.Math etc. ... Read More
What is the main functionality of the Remote Reference Layer?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Are there any other 'marker' interfaces?
Added on Tue, Dec 29, 2009
java.rmi.Remote java.util.EventListener Read More
In which case i can go for Anonymous class?
Added on Tue, Dec 29, 2009
Ananymous classes are useful when you want to extend more than one class at a time ( Java doesn't support )and also it doesn't require next time. Ex: Frames with ananymous classes for handiling the events with in a same program. Read More
can the main() method be overloaded? or overrided? and what happens when we do so?
Added on Tue, Dec 29, 2009
yes, It cam be overloaded, I am not sure if it can be overridden. In over loading u have same method name with different parameteres. So main can have no params or it can have a String objects as arguments. The purpose of passing string as args... Read More
What is the difference between a while statement and a do statement?
Added on Tue, Dec 29, 2009
A while statement checks at the beginning of a loop to see whether the next loop iterationshould occur. Ado statement checks at the end of a loop to see whether the next iteration of a loop shouldoccur. The dostatement will always execute the body... Read More
What are the advantages of OOPL?
Added on Tue, Dec 29, 2009
Object oriented programming languages directly represent the real life objects. The features of OOPL as inhreitance, polymorphism, encapsulation makes it powerful. Read More
What is your platform's default character encoding?
Added on Wed, Dec 30, 2009
If you are running Java on English Windows platforms, it is probably Cp1252. If you arerunning Java on English Solaris platforms, it is most likely 8859_1.. Read More
Can i limit the initial capacity of vector in java?
Added on Wed, Dec 30, 2009
Ya u can limit the initial capacity we can construct an empty vector with specified initial capacity public vector(int initialcapacity) Read More
Why we use OOPS concepts, What is its advantage?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is a refferent
Added on Tue, Dec 29, 2009
A reference variable or constant declared as 'final' has a value that is immutable and cannot be modified to refer to any other object than the one it was initialized to refer to. Thus the 'final' specifier applies to the value of... Read More
What is the difference between Iterator and Enumeration
Added on Tue, Dec 29, 2009
Iterator is returned by List and other Collection interfaces. Iterator is fail fast if a modification to the collection is performed while iterating. Enumeration is used by Vector and Hashtable. Enumeration may or may not throw an error if the... Read More
JVM is platform independent/dependent?why?
Added on Tue, Dec 29, 2009
Question : JVM is platform independent/dependent?why? 2) which one is faster in execution Array List or Array? why? Answers: JVM is platform dependent. Just think u don' t use a unique jdk for each operating system.... Read More
What is upward and downward casting in Java?
Added on Wed, Dec 30, 2009
upward casting small datatype is casted in to big data type such as byte is casted as int type.but in downward casting the big data type is casted into small data type such as long is casted into int or byte. Read More
What is the difference between attribute and parameter ?
Added on Mon, Dec 28, 2009
attribute - is a member of a class parameter - is a member of a method signature argument - is used to send values to the method from the caller. parameter - is a place holder for the incoming values for a method from the caller. Read More
What is JVM?
Added on Mon, Dec 28, 2009
An abstract computing machine, or virtual machine , JVM is a platform - independent execution environment that converts Java bytecode into machine language and executes it. Read More
What is java virtual machine and what is its uses?
Added on Tue, Dec 29, 2009
JVM is basic run time environment for java applications. Where all java objets birth,live and dead. Read More
What classes of exceptions may be caught by a catch clause?
Added on Tue, Dec 29, 2009
A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Errorand Exception types. Read More
Can you invoke the methods on a Thread once it is stopped?
Added on Tue, Dec 29, 2009
Yes, why not? It's just a class with methods just like any other class. Read More
What is the exact difference in between Unicast and Multicast object ? Where we will use ?
Added on Tue, Dec 29, 2009
The following some information regarding the question: The information was taken from (http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=1&t=000875) written by sasikala kumaresan A unicast packet is the complete... Read More
What is Weak reference and Soft reference in java?
Added on Tue, Dec 29, 2009
Soft Reference :--> An object is softly reachable if it is not strongly reachable and there is a path to it with no weak or phantom references, but one or more soft references. The garbage collector might or might not reclaim a softly reachable... Read More
Will class level variables are garbage collected?
Added on Wed, Dec 30, 2009
The following link has discussion about static variables being garbage collected. The last posting in the discussion gives a lot of relevant information. http://www.codeguru.com/forum/printthread.php?t=362966 justAnother Read More
When we will use an Interface and Abstract class?
Added on Wed, Dec 30, 2009
We do implement a interface when we want to add a specific characteristic to a class like if we want a particular human being is a singer then we can implement the singer interface to add this characteristic to a particular person.Interface... Read More
Why single inheritance cannot be use in java/why we alwayz use multiple inheritances?
Added on Tue, Dec 29, 2009
Single inheritance, multilevel inheritance and hierarchial inheritance is allowed in java. Muliple inheritance and hybrid inheritance is not allowed because implementing these in Java will cause data duplication and ambiguity. The derived class... Read More
What synchronization constructs does Java provide? How do they work
Added on Tue, Dec 29, 2009
When you synchronize on an object your thread gains exclusive use of that object until synchronization ends or wait is called on the object. Language support for synchronization: 1. Use the synchronized block: In a method you may: synchronized... Read More
What is Clonnable Interface in java? IS it implemented by the ProtoType Design Pattern?
Added on Tue, Dec 29, 2009
The cloneable interface is provided by java for the classes that want to suporrt the function clone or want to override it. This function is supposed to to create and return the copy of an object. Read More
What is the difference between a break statement and a continue statement?
Added on Tue, Dec 29, 2009
A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to theloop statement. Read More
Write down how will you create a binary Tree?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What's the difference b/w Java command line arg.s & C command line arg.s?
Added on Wed, Dec 30, 2009
THERE IS ONE MAJOR DIFFERENCE IN COMMANDLINE ARGUMENTS OF JAVA AND C.LET US ASSUME THERE IS AN EXECUTBLE FILE NAMED"COPY. EXE", WHICH SOURCE CODE IS IN C AND TAKES 2 COMMANDLINE ARGUMENTS THEN WE WILL RUN IT AS SHOWN BELOW C:>COPY SOURCE,DEST -... Read More
How many JVM's we can run in a system?
Added on Wed, Dec 30, 2009
JVM is java virtual machine which should be there on an operating system for any java application to be run on.so, it depends on how many operating sytems you have on your system installed. if you want the JVM installed on all the operating systems... Read More
What is the difference between the File and RandomAccessFile classes
Added on Wed, Dec 30, 2009
The File class encapsulates the files and directories of the local file system. The RandomAccessFile classprovides the methods needed to directly access data contained in any part of a file. Read More
How many different types of JDBC drivers are present? Discuss them
Added on Mon, Dec 28, 2009
Type 1: JDBC-ODBC Bridge plus ODBC Driver: The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases through ODBC drivers. The ODBC driver must be configured on the client for the bridge to work.... Read More
What is the difference between instanceof and isInstance?
Added on Mon, Dec 28, 2009
instanceof is used to check to see if an object can be cast into a specified type without throwing a cast class exception. isInstance() determines if the specified object is assignment-compatible with the object represented by this Class. This... Read More
What is synchronization and why is it important?
Added on Mon, Dec 28, 2009
Synchronization occurs when you want two threads to run, but they are somewhat dependent on each other. A thread is a distinct flow of program logic that can be executed at the same time as other threads. This make it seem like two things are... Read More
What is the webserver used for running the Servlets?
Added on Mon, Dec 28, 2009
Web server for running the servlets:Mainly to run the servlets we will use Apache Tomcat sever,Sunone Studio.(websevers).But servlets also run in the Application server such as Weblogic,websphere,Jboss. Submitted by Chinnakotla Devarathnam ... Read More
What is the difference in between C++ and Java. can u explain in detail?
Added on Mon, Dec 28, 2009
Java: There are no pointers. There is no Operator Overloading. There are no preprocessors. There are no Structures and Unions. There are no Enums. There are no Functions (only methods within class). There is no goto statement.(In java goto and... Read More
What value does readLine() return when it has reached the end of a file?
Added on Mon, Dec 28, 2009
The readLine() method returns null when it has reached the end of a file. Read More
What is the purpose of the wait(), notify(), and notifyAll() methods?
Added on Tue, Dec 29, 2009
The wait(), notify(), and notifyAll() methods are used to provide an efficient way forthreads to wait for a shared resource. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after... Read More
What's new with the stop(), suspend() and resume() methods in JDK 1.2?
Added on Tue, Dec 29, 2009
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2. Read More
What is the difference between an object and an instance? And give me a real time example to differentiate these two?
Added on Tue, Dec 29, 2009
An Object May not have a class defination eg int a[] where a is an array An Instance Should have a class defination eg MyClass my=new MyClass(); my is an instance Read More
How will you initialize an Applet?
Added on Tue, Dec 29, 2009
by using init() methd applet method can be initiaized Read More
Explain Garbage collection mechanism in Java
Added on Tue, Dec 29, 2009
Collecting the objects taht are no longer used. java uses System.gc() method or Runtime.gc() method here Read More
Addition of two numbers using Bitwise operators.
Added on Tue, Dec 29, 2009
Question : Addition of two numbers using Bitwise operators. Reading An 2D array using single for loop Answers: this is power of 2 without using any operator and any math function class power { ... Read More
What are the different XML files used in J2EE?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
If interface has got four methods,and I like to implement only two methods, how this could be achieved?
Added on Tue, Dec 29, 2009
I have an idea. But I am not sure if it is the right answer. Can I divide these 4 methods into 2 interface? Then I can only implement the wanted 2 methods. Read More
Why Java is not 100 % pure OOPS
Added on Tue, Dec 29, 2009
There are so many examples behind this reason. a. Code written using AWT and compiled on windows machine will not run on Unix, since Windows is a graphics rendered environment and unix is not, so will have to provide some XManger to render the... Read More
Which class should you use to obtain design information about an object?
Added on Tue, Dec 29, 2009
The Class class is used to obtain information about an object's design. Read More
What is a Singleton class, what is it's significance
Added on Wed, Dec 30, 2009
Singleton is one and only one instance of a Class for a class loader, which is used by all users of application. Public class Singleton { Singleton singleton = null; private Singleton () {} // Inportant public static Singleton... Read More
What is the latest version of JDBC. What are the new features are added in that?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What method should the key class of hashmap override
Added on Wed, Dec 30, 2009
The methods to over ride are equals() and hashCode(). Read More
What is multi threading ?
Added on Wed, Dec 30, 2009
when more than two task are permorming under a singel process,is known as multithreading Read More
What modifiers may be used with an inner class that is a member of an outer class
Added on Wed, Dec 30, 2009
Any Vector methods acsess which operate on data is Synchronized. Read More
Explain RMI Architecture
Added on Wed, Dec 30, 2009
Java Remote Method Invocation (Java RMI) enables the programmer to create distributed Java technology-based to Java technology-based applications, in which the methods of remote Java objects can be invoked from other Java virtual machines*,... Read More
How to access the values java to javascript?
Added on Wed, Dec 30, 2009
<% String str = "123"; %> <script> function f() { alert('<%=str%>'); } </script> I am not sure if the above code works. The better way could be to send the java values to the... Read More
What is the life cycle of an applet
Added on Wed, Dec 30, 2009
All applets have the following four methods: public void init(); public void start(); public void stop(); public void destroy(); Read More
What is mutable and immutable in Strings?
Added on Wed, Dec 30, 2009
Mutable string means we can append to that string.example StringBuffer object is mutable string.String is immutable object when we declre String="abc"; a string object abc with fixed length is created.We cant add anything to it .If we do java... Read More
How will you pass values from HTML page to the Servlet?
Added on Mon, Dec 28, 2009
We can pass values to servlet from HTMLpage using "request.getParameter(string);" method.Which is a method in the HttpServletRequest interface. Submitted by chinnakotla devarathnam (devarathnam@yahoo.co.in) Read More
What is the difference between Java and J2EE? Is J2EE advanced version of Java?
Added on Mon, Dec 28, 2009
Java is a object-oriented programming language which is platform neutral. That is unlike C or C++ java programs, Java can be run on any operating system with its JVM. J2EE is just a specification for server side programs. That is to support... Read More
What restrictions are placed on method overloading?
Added on Mon, Dec 28, 2009
Two methods may not have the same name and argument list but different return types. Read More
What is JAR file?
Added on Mon, Dec 28, 2009
JAR file stands for Java ARchive, a compressed file like zip, rar, lha files. Using the jar command, a JAR file is commonly used for packaging Java classes (.class). Submitted by Tsar Primo Geronimo (tsar2020@hotmail.com) ________________ ... Read More
Are true and false keywords?
Added on Tue, Dec 29, 2009
The values true and false are not keywords. Read More
Is null a keyword?
Added on Tue, Dec 29, 2009
How to use printer option in java or is there any method to use print command?
Added on Tue, Dec 29, 2009
To handle data in the form of text the abstract classes:Reader and Writer are used. in this Print reader/writer handle printing of characters on the screen or on the printer. Streams represents IO devices.by using streams to handle IO devices.by... Read More
What is the difference between CGI and Servlet?
Added on Tue, Dec 29, 2009
CGI creates process for each client call where as servlet creates process for the first time and then uses thread for each client. Submitted by Sunanda Yugandhar (sunanda.yugandhar@aspiresys.com) Read More
What is the abstraction? Give example?
Added on Tue, Dec 29, 2009
Abstraction means to hide the unnecessary data so we use for that abstract class or abstract methods. EX:abstract class car { abstract void fun() {} } Read More
How does a try statement determine which catch clause should be used to handle an exception?
Added on Tue, Dec 29, 2009
When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exception is executed. The remaining catch... Read More
what is servelet?
Added on Tue, Dec 29, 2009
Servlet: Servlet is java web application component.or a java program which implements the Servlet interface.The duty of servlet is as follows: 1. Retriving the client request. 2. Processing the client request. 3. Generate the response w.r.t client... Read More
What is the purpose of the Runtime class?
Added on Tue, Dec 29, 2009
The purpose of the Runtime class is to provide access to the Java runtime system. Read More
Is sizeof a keyword?
Added on Tue, Dec 29, 2009
The sizeof operator is not a keyword. Read More
What is the difference between the prefix and postfix forms of the ++ operator
Added on Tue, Dec 29, 2009
The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation onthat value. Read More
What is serializable Interface?
Added on Tue, Dec 29, 2009
Serializable Interface :It is a marker interface ,which does not contain any methods and constants.But it is used for protocol purpose. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What is the purpose of the enableEvents() method?
Added on Tue, Dec 29, 2009
The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabledwhen a listener is added to an object for a particular event. The enableEvents() method isused by objects that handle events by overriding... Read More
What do you know about the garbate collector?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Is java a fully object oriented programming or not? if not why?
Added on Tue, Dec 29, 2009
Depends on the definition of " fully object oriented programming".There is no such term in Java World IMHO. Read More
What is the difference between Comparable and Comparator?
Added on Tue, Dec 29, 2009
The comparable interface should be used when the current object is to be compared to objects of its type only. The comparator should be used when some external class is taking your class as a parameter for some comparison operation and it doesn'... Read More
Can you make a method final, without making the whole class final?
Added on Tue, Dec 29, 2009
Definitely we can make a method final, without making the whole class as final. ex: public class MyClass { private String name = "Ram"; public String getName() { return name; } final void display(String str) { System.out... Read More
What is layout manager ? How does it work ?
Added on Tue, Dec 29, 2009
A layout manager is an object that positions and resizes the components in a Container according to some algorithm; for example, the FlowLayout layout manager lays out components from left to right until it runs out of room and then continues... Read More
What is the difference between Abstract class and Interface?
Added on Tue, Dec 29, 2009
Abstract class: Abstract class can contain abstract methods and concreat methods (implementatioin methods). Interafe : An Interface contains only abstract methods(not concreate methods). Submitted by Devarathnam.C (devarathnam@yahoo.co.in) Read More
Where should u use reflection in ur project? give me one example?
Added on Tue, Dec 29, 2009
Reflections are basically used to find the details of a class based on the object . Read More
Solve it...
Added on Tue, Dec 29, 2009
Question : Solve it... public class test { public static void main(String[] args) { int i=5; i=i++; System.out.println("result::"+i); } } The result wil be 5..!! and not 6 why??? Answers: i=i++ can be... Read More
What is the difference between Stream Reader and Stream Writer?
Added on Tue, Dec 29, 2009
Stream Reader A Stream Reader is a bridge from byte streams to character streams: It reads bytes and translates them into characters according to a specified character encoding. The encoding that it uses may be specified by name, or the platform&... Read More
Explain Java Memory Model?
Added on Tue, Dec 29, 2009
The Java Memory Model defines how threads interact through memory. Read More
wat is the disadvantage of threads?
Added on Tue, Dec 29, 2009
The main disadvantage of thread is that we need to synchronize the object while using the thread Read More
What is the difference between a Scrollbar and a ScrollPane
Added on Wed, Dec 30, 2009
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. AScrollPane handles its own events and performs its own scrolling. Read More
When does JIT plays its role. Does JIT come along with jdk? If so then what is role of interpreter?
Added on Wed, Dec 30, 2009
JIT- just in time compiler Yes, it comes along with the java kit, actully it compiles the program. Actully the interpreter converts the high level lanhuage into machine level language, one by one. Since the java has a lot of run time... Read More
What is serialization?What is transient?What is the default value of a transient variable?
Added on Wed, Dec 30, 2009
Serialization is the state of write the object in the byte stream transient r applied to the variables the value cannot be persisit when the object r stored Read More
Why java dosen't support pointers?
Added on Wed, Dec 30, 2009
java doesnt support pointers as its a tedious job to locate memory as in c++.one of the major problem in most oops languages is to handle memeory allocation.programmer had to explicitely handle memory for the programs max utilization.java doesnt... Read More
Differences between servlet context and servlet config?
Added on Wed, Dec 30, 2009
ServletConfig is assosiated with Servlet Where as ServletContext is assosiated with Web Application(or context path). Come 2 DD(web.xml) perspective, The data In <init-param> tag is specific 2 that perticular servlet.u can use that... Read More
What is the difference between java and core java
Added on Wed, Dec 30, 2009
i think Core java is more specific to the OOP concepts and it. Java covers a much picture like J2ee technologies/specifications which by itself is huge. Read More
How do you invoke a Servelt. What is the difference in between doPost and doGet methods?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the notation for matrix in java?
Added on Wed, Dec 30, 2009
Array is the collection of Similar data type and has fix size. datatype arrayname[]=new datatype[size]; or datatype []arrayname=new datatype[size]; eq: int a[]=new int[10]; Two Dim Array: datatype arrayname[][]=new datatype[rows]... Read More
Write a program for recursive Traverse?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why the container does not support multiple layout managers
Added on Wed, Dec 30, 2009
Because when u r using a particular layout manager it ues full fram for work you can use gridbag layout for this purpose Read More
Why do you Canvas
Added on Wed, Dec 30, 2009
Canvas is a component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user. Read More
Why Java is not fully objective oriented
Added on Wed, Dec 30, 2009
There are 2 reasons that i can think of: 1. java support for primitive data type 2. no direct implementation of multiple inheritence Howerver java has a way out of these two issues in form of: 1. wrapper classes 2. interfaces Read More
What are the various ways of creating a thread. What is difference between them
Added on Wed, Dec 30, 2009
The thread can be created either by extending the Thread class or implement the Runnable interface. Read More
Can the abstract class be final?
Added on Mon, Dec 28, 2009
No, Combination of modifiers final and abstract is illegal in java. Submitted by Rama Krishna ( iamvemuri @ yahoo . com ). Read More
What are the high-level thread states?
Added on Tue, Dec 29, 2009
The high-level thread states are ready, running, waiting, and dead. Read More
What is the difference between exception and error?
Added on Tue, Dec 29, 2009
Error occurs at compile-time, while exception occurs at run-time. Read More
What is the difference between the String and StringBuffer classes?
Added on Tue, Dec 29, 2009
String objects are constants. StringBuffer objects are not. Read More
How does multithreading take place on a computer with a single CPU
Added on Tue, Dec 29, 2009
By quickly switching among executing tasks, it creates the impression that the tasks execute simultaneously. If it didn't switch among the tasks, they would execute sequentially. Read More
What are the actual functions of JVM?
Added on Tue, Dec 29, 2009
Question : 1)What are the actual functions of JVM? 2)When to use a class and when to use an Abstract class? 3)what is the use of constructors other than creation of objects? 4)when to use constructors? 5)when to use Interface? 6... Read More
What is the difference between wait(), join(), sleep(), notify() & notifyall() methods?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Does Java have destructors?
Added on Tue, Dec 29, 2009
There is no concept of "destructors" in java.Java supports this specility by introducing the "GarbageCollector".The Garbagecollector is under the control of the JVM.JVM runs the Garbagecollector periodically basing on "mark and sweep" algorithms.U... Read More
How can u move/drag a component placed in Swing Container
Added on Tue, Dec 29, 2009
Thanks in advance.i want to move a JButton using Mouse in runtime within a JFrame.saran Read More
What is difference between try and throws, as these are two different methods to handle the exceptions.
Added on Tue, Dec 29, 2009
Try / catch is used to guard against possible errors or problems. At the minimum the error should at least be reported to the user or logged in some way. More advanced systems will attempt to recover from the error and continue with normal operation.... Read More
Which Math method is used to calculate the absolute value of a number?
Added on Tue, Dec 29, 2009
The abs() method is used to calculate absolute values. Read More
Write program for single objects returns two instances
Added on Tue, Dec 29, 2009
I think this is the one of the way to return two refference fro one Object ClassA extends from ClassB then in ClassB we can write like this ClassB b=new ClassB(); this is one and ClassA a= new ClassB(); this is two of... Read More
What are the differences between EJB and Java beans
Added on Tue, Dec 29, 2009
The main difference: Javabean is a reusable s/w component that can be developed & run within a single system. EJB is used in distributed environment. EJB is developed in one node made to run in any system. Read More
What is the significance of null interface in Java?
Added on Tue, Dec 29, 2009
The null interface is also called as Marker Interface. EX:In J2EE applications,if u want to make any servlet as thread safe,then we make as such,through the SingleThreadMarkerInterface. For this ur servlet just need to implement this... Read More
If i create a object which is to be serialized then do I need to implement any methods
Added on Tue, Dec 29, 2009
You just need to implement the Interface Serializable and don't have to implements any methods.This is because Serialiazble Interface has no methods.Its just a Marker/Tag Interface which tells that this object is serilizable. Read More
How many times may an object's finalize() method be invoked by the garbage collector?
Added on Tue, Dec 29, 2009
An object's finalize() method may only be invoked once by the garbage collector. Read More
Can an unreachable object become reachable again?
Added on Tue, Dec 29, 2009
An unreachable object may become reachable again. This can happen when the object's finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable objects. Read More
What is difference in between Java Class and Bean
Added on Tue, Dec 29, 2009
A class with no restriction on accesors , mutators or constructor can be considered as a plain Java class.Java Bean is a spl java class with accessors(getters) and mutators(setters) for the instance variables present.Moreover, it can only have a... Read More
What is class variables and instance variables?
Added on Tue, Dec 29, 2009
Class variable are class member which are used in the class and instance variable is a object of that class to be used to access methods of that class. Read More
Can an anonymous class be declared as implementing an interface and extending a class?
Added on Wed, Dec 30, 2009
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both. Read More
Difference between Applet and JApplet
Added on Wed, Dec 30, 2009
JApplet is actually a subclass of Applet, so JApplets are in fact Applets in the usual sense. However, JApplets have a lot of extra structure that plain Applets don't have. Read More
How many layout's are there in java? explain each one of them
Added on Wed, Dec 30, 2009
Total 5 are there:1.Flow layout.2.Boarder Layout 3.CardLayout 4.GridLayout. 5.FlexGridBagLayout.1.Flow:its defalut layout,it can arranged left to right.2.Boarder:its arranged North,West,South,East order.3.Card:it follows deck of cards(like playing... Read More
Why should every class in java extend Object class?
Added on Wed, Dec 30, 2009
The garbage collector invokes an object's finalize() method when it detects that the objecthas become unreachable. In java u can access the data through objects.Here Object class is a super/base/parent class for all the java classes,so it... Read More
How to communicate 2 threads each other
Added on Wed, Dec 30, 2009
Two thread communicate using the notify, notifyAll and yield methods provided in the Runnable Interface. Read More
What is anonymous class
Added on Wed, Dec 30, 2009
An inner class without naming is called an anonymous class Read More
Tell me the latest versions in JAVA related areas?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why default constructor of base class will be called first in java?
Added on Wed, Dec 30, 2009
Because from any constructor of the subclass first a call is made to super() unless you specifically make any super call with args() eg super(arg1,arg2). Read More
What is meant by Session, Tell me something about HTTPSession Class?
Added on Wed, Dec 30, 2009
Session is used to maintain state of the user bcz Http is stateless protocal. HttpSession class is used to create a session for an application. Read More
Tell me the differences between enumeration and iteration?Which can use where in realtime?
Added on Wed, Dec 30, 2009
Enumeration and Iterator both are interfaces present in util package. Enumeration is a legacy interface which does not come under the collection framework, wheras Iterator is an interface present in the collection framework. All the legacy classes... Read More
What is client server computing?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)? How does AWT work?
Added on Wed, Dec 30, 2009
The AWT toolkit is an interface between the abstract window layer and a specific windowing implementation. Read More
How can u tell HashTable is Synchronized?(IBM-chennai)
Added on Wed, Dec 30, 2009
This example creates a hashtable of numbers. It uses the names of the numbers as keys: Hashtable numbers = new Hashtable(); numbers.put("one", new Integer(1)); numbers.put("two", new Integer(2)); numbers.put("three", new Integer(3)); To retrieve... Read More
How to compare Stringbuffer objects?
Added on Wed, Dec 30, 2009
String objects are immutable. Well let me explain taking an example:Look at the code below along with the comments:String test = " Java"; // Create a string object "java" and assign a reference 'test ' to it.String test2 = test; //create... Read More
What is ServerSocket. How will you create a connection
Added on Wed, Dec 30, 2009
ServerSocket is a class for creating a server side connection for remote clients to connect to, On client connection success, returns an ordinary socket which can later be used to communicate with the client. For a connection to be created it... Read More
What are statements in JAVA?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the disadvantage of threads?
Added on Mon, Dec 28, 2009
The Main disadvantage of threads is : Threads is operating system dependent. Read More
What are wrapped classes?
Added on Mon, Dec 28, 2009
Wrapped classes are classes that allow primitive types to be accessed as objects. Read More
How System.out.println() works?
Added on Mon, Dec 28, 2009
System.out.println();incase System is a class in java.lang package.And out is the static field in the java.lang.System class. It works by a native method. Read More
Name four Container classes?
Added on Mon, Dec 28, 2009
Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane. Read More
Why java does not support Multiple Inheritance?
Added on Mon, Dec 28, 2009
The java designer's view was to develop a simple, object oriented, and familiar language. In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. Read More
What is the command pattern ?where it is used?
Added on Mon, Dec 28, 2009
This is another of the data-driven pattern. The client invokes a particular module using a command. The client passes a request, this request gets propagated as a command. The command request maps to particular modules. According to the command, a... Read More
Why Java is not 100 % pure OOPS?
Added on Tue, Dec 29, 2009
A pure Object Orientad Language is which implements All the OOP concepts. Java doesn't support Multiple Inheritance & Operator loading thats why "Java is not 100% pure Object Language". C# is a pure OOP Language. Read More
what are the other ways to create an object otherthan creating as new object
Added on Tue, Dec 29, 2009
create new object otherthan using new operator in java ObjectType obj = className.getMethod(); above coding obj is object return by method getMethod Read More
What is the relationship between clipping and repainting?
Added on Tue, Dec 29, 2009
When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting. Read More
What is the difference b/w Iterator & ListIterator
Added on Tue, Dec 29, 2009
Iterator :--- Iterator takes the place of Enumeration in the Java collections framework. One can traverse throughr the the collection with the help of iterator in forward direction only and Iterators allow the caller to remove elements from the... Read More
What are the different XML files used in J2EE
Added on Tue, Dec 29, 2009
For struts we use struts-config.xml, web.xml. and for ejb we normally use ejb- jar.xml, deployment descriptor also in xml form. Read More
How are commas used in the intialization and iteration parts of a for statement?
Added on Tue, Dec 29, 2009
Commas are used to separate multiple statements within the initialization and iteration parts of a for statement. Read More
How to invoke the primitive types within object in arraylist?
Added on Tue, Dec 29, 2009
In array list we can save only objects by using the method add(Object).if we can we save primitive data types in array list ,then wrap the primitive value to its corresponding Wrapper class then add that object to the array list.after retrieving the... Read More
What is the catch or declare rule for method declarations?
Added on Tue, Dec 29, 2009
If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause. Read More
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8characters?
Added on Tue, Dec 29, 2009
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set usesonly 7 bits, it isusually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns.UTF-16 uses 16-bit and larger bit patterns. Read More
What is garbage collection?Can it be forced?
Added on Tue, Dec 29, 2009
In java deallocation is handled automatically.When there is no reference to an object exists, it means the object is no longer needed then the object is destroyed automatically is called garbage collection.Garbage collection only occurs... Read More
What is difference between string and stringtokenizer
Added on Tue, Dec 29, 2009
A StringTokenizer is utility class used to break up string. e.g. StringTokenizer st = new StringTokenizer("Hello World"); while (st.hasMoreTokens()) { System.out.println(st.nextToken()); } Output: Hello World Read More
What is the Collections API?
Added on Tue, Dec 29, 2009
The Collections API is a set of classes and interfaces that support operations oncollections of objects. Read More
Size of object in java : Is there any way in java to find of size of an object ?( like sizeof() operator of C/C++ )
Added on Tue, Dec 29, 2009
You can check Runtime r = Runtime.getRuntime() ;r.freeMemory() ;before and after the creation of the new Object you can check the memorty and by subtraction u can get the used memory. Not accurate but useful. Read More
What do you know about networking support in Java?
Added on Tue, Dec 29, 2009
Java supports "low-level" and "high-level" classes. "Low-level" classes provide support for socket programming: Socket, DatagramSocket, and ServerSocket classes. "High-level" classes provide "Web programming": URL, URLEncoder, and URLConnection... Read More
What advantage do Java's layout managers provide over traditional windowingsystems?
Added on Tue, Dec 29, 2009
Java uses layout managers to lay out components in a consistent manner across allwindowing platforms.Since Java's layout managers aren't tied to absolute sizing and positioning, they are ableto accomodateplatform-specific differences... Read More
What is Synchronisation in threads?
Added on Tue, Dec 29, 2009
Collection: Collection is an interfact within in collection framework.collection framework provides many interfaces likes collection,maps,etc.list and set both are the interface and both interface implement collection interface. Read More
Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3
Added on Tue, Dec 29, 2009
Question : Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3 and at freshman level. Answers: ... Read More
If an object is garbage collected, can it become reachable again?
Added on Tue, Dec 29, 2009
Once an object is garbage collected, it ceases to exist. It can no longer become reachable again. Read More
How can I swap two variables without using a third variable?Can u plz tell me the logic behind it..?
Added on Tue, Dec 29, 2009
Add two variables and assign the value into First Variable.Subtract the Second value with the Resul Value. and assign to Second Variable.Subtract the Result of First Variable With Result of Second Variable and Assign to First Variable.EX:Int a=5,b=10... Read More
What is the difference between RMI & Corba?
Added on Tue, Dec 29, 2009
Difference b/w RMI AND CORBA: RMI(Remote Method Invocation ),CORBA(Common Object Request Broker Architecture) both are specifications or technologies,which are used in the Distrubuted environment. RMI is a language dependent ,but platform... Read More
When we need of abstract class and interface?could you please tell me the realtime example?
Added on Tue, Dec 29, 2009
If there is a functionality (like employee) that is common across specific classes, then specific classes (Hourly Employee) can be inherited from the common class. What if there is no common functionality, but there is a common contract that classes... Read More
What is JAR file
Added on Tue, Dec 29, 2009
The JavaTM Archive (JAR) file format enables you to bundle multiple files into a single archive file. Typically a JAR file will contain the class files and auxiliary resources associated with applets and applications. Read More
What is BYTE Code?
Added on Tue, Dec 29, 2009
Byte code is the output of java compiler. Unlike C,C++ which produce executable code after compilation,java compiler generates byte code which is platform independent. JVM interpretes this byte code and generates native/machine code which is... Read More
Disadvantages of Java
Added on Tue, Dec 29, 2009
Java language runs on a virtual machine, it runs somewhat slowly compared to other programs. It is difficult to write a perfect program, especially if it is as big as a virtual machine Read More
What is the difference between a field variable and a local variable?
Added on Tue, Dec 29, 2009
A field variable is a variable that is declared as a member of a class. A local variable is avariable that is declared local to a method. Read More
What is the difference between exception and error
Added on Tue, Dec 29, 2009
An Exception can be caught and recovered: ArrayIndexOutOfBoundsException means you tried to access a position of an Array that does not exist - no big deal. An Error is unrecoverable: OutOfMemoryError means that the JVM has no more memory to... Read More
What is J2EE?
Added on Tue, Dec 29, 2009
J2EE stands for Java2 Enterprise Edition it is not a single technology it comprise many technology, J2EE is an specification used to build web application Read More
what happens if we execute the program
Added on Tue, Dec 29, 2009
Question : what happens if we execute the program? class Return{ int display(){ try{ return 1; } finally{ return 2; } } public static void main(String args[]){ Return r=new Return(); r.display(); } } ... Read More
Given a text file, input.txt, provide the statement required to open this file with the appropriate I/O
Added on Tue, Dec 29, 2009
FileReader FR = new FileReader("C:/input.txt"); BufferedReader reader = new BufferedReader(FR); //Used for reading line by line while( (reader.readLine())!=null) { //Write ur logic here } Read More
Which Collection class is used for LIFO in Java?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why we write server side programs? what is its main purpose?
Added on Tue, Dec 29, 2009
Server side programming used to improve file dowloading performance, it hendles the server. Read More
How hashtable is synchronized?why hashmap is not synchronized?Can we make hashmap synchronized?
Added on Tue, Dec 29, 2009
Hashtable and HashMap both are Key Value pairs and they function both the same way except in sychronization and HashMap accepts one null Key and many null values. HashMap can be synchronized by Map m = collections.synchronizeMap(hashMap); Read More
What are the various access modifiers in Java. Differences between them?
Added on Tue, Dec 29, 2009
transient,volatile,final,static transient 9for variable):-- variable's state can't be serialized. final:-- can be declared for class,METHODS as well as variables, who's definition can't be changed. static :-- variable ... Read More
send me some interview questions on Stringhandling concept
Added on Tue, Dec 29, 2009
Regarding use of equals on StringBuffer and String : Since StringBuffer diesn't override equals therefore such a comparison will always give false in case of StringBuffer. Read More
It is a saying that static methods in JAVA programs should be minimised. What is the reason for this? any problems arise or there is any performance measures to be looked into it.
Added on Tue, Dec 29, 2009
Static Method shld be minimised in Java Programm.For Ex . if i am m accessing any method and request modified the object then when other request comes it wll met to modfied Object.So we shld minimise the Static method in Java program as Original ... Read More
How come hashcodes can be the same even if objects aren't equal?
Added on Tue, Dec 29, 2009
If you override equals() method and say { return false; } , even same objects will not be equal. If that was not the trick question the interviewer meant, then I think that if there are two different objects, even though they may have same values... Read More
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class
Added on Tue, Dec 29, 2009
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented. Read More
what are the other ways to create an object otherthan creating as new object?
Added on Tue, Dec 29, 2009
int, float etc are primitives not objects so that part is ruled out. String s= "hello" is a valid way other valid ways include reflection also by using methods that return new objects Date d= Date.getInstance(); Toolkit tk= Toolkit... Read More
What is heap in Java
Added on Tue, Dec 29, 2009
JAVA is fully Object oriented language. It has two phases first one is Compilation phase and second one is interpratation phase. The Compilation phase convert the java file to class file ( byte code is only readable format of JVM) than... Read More
What modifiers may be used with an interface declaration
Added on Tue, Dec 29, 2009
An interface may be declared as public or abstract. Read More
What is the difference between StringBuffer and String class?
Added on Tue, Dec 29, 2009
A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed... Read More
What are STRUTS
Added on Tue, Dec 29, 2009
Struts is a framework provided by Apache group. It uses MVC2 model architecture. It is overcoming the drawbacks of old MVC model. If we use Struts in our application development, there is no need of creating any ActionServlet. Struts framework will... Read More
Name the eight primitive Java type.
Added on Tue, Dec 29, 2009
1)boolean 2)int 3)float 4) byte 5)short 6)char 7)long 8)double Read More
What is the primary advantage of XML driven Java Beans
Added on Tue, Dec 29, 2009
Primary Advantages is, we don't need to add code in Java Class(attribute, Mutator Method[get/set]), Sipmply we can add new attributes by modifying XML files. Eg . ActionForm and DynaActionForm in Struts FrameWork. Read More
Imagine there is a class Employee. We create an object of Employee
Added on Tue, Dec 29, 2009
Question : Imagine there is a class Employee. We create an object of Employee Employee a= New Employee(); If we are giving System.out.println(a); What gets printed? Answers: It calls the toString() method of the... Read More
When is an object subject to garbage collection?
Added on Tue, Dec 29, 2009
An object is subject to garbage collection when it becomes unreachable to the program in which it is used. Read More
What are the primitive types in Java?
Added on Tue, Dec 29, 2009
According to Java in a Nutshell, 5th ed boolean, byte, char, short, long float, double, int Read More
Which on is best string or string buffer?which one is mutable and immutable?
Added on Wed, Dec 30, 2009
Strings are not dynamically growable but String buffer is dynamically growable Read More
Why arraylist(and other classes) cantnot be synchronized
Added on Wed, Dec 30, 2009
ArrayList can not be synchronized because in synchronization the same data at the same time can access with out data loss or data corruption but in ArrayList it is not possible. Read More
Is there any set methods to set the background color of our java o/p screen,i.e,after completion of my program ,i want to change my background color of DOS prompt?
Added on Wed, Dec 30, 2009
You can not change the background colour of DOS prompt by java. You can change the DOS prompt colour by changing the settings of DOS prompt.(click on the properties->Color from DOS prompt screen). Read More
Assume you are experiencing a deadlock situation on a java server application ? what is your approach to identify the problem.?
Added on Wed, Dec 30, 2009
No answer available currently. Be the first one to reply to this question by submitting your answer from the form below. Read More
Which java.util classes and interfaces support event handling?
Added on Wed, Dec 30, 2009
The EventObject class and the EventListener interface support event processing. Read More
What is runtime polimorphism? give an example program ?
Added on Wed, Dec 30, 2009
Runtime polymorphism is the concept of identifying the object reference at run time.This is also called as Late/Dynamic Binding in C++. The following example explains you how it works. class SuperHandler { public String handleRequest() { return... Read More
What are the files generated after using IDL to Java Compilet
Added on Wed, Dec 30, 2009
The following files will be generated: My.java MyHelper.java MyHolder.java MyOperations.java _MyStub.javal Read More
Which class is the immediate superclass of the MenuComponent class.Object?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Is null a keyword
Added on Wed, Dec 30, 2009
According to Java null is a key word literal. So are true and false.They cannot be used as variable names even though they are not keywords. Read More
Why we cannot define constructor of super class in a sub class ?
Added on Wed, Dec 30, 2009
We not define the constructor of super class in subclass because when we extend the class then property of superclass come in subclass.. Read More
If my java based application is hanging once in a while. Where would you start looking at the problem, what changes can you do?
Added on Wed, Dec 30, 2009
Question : If my java based application is hanging once in a while. Where would you start looking at the problem, what changes can you do? My application has a builtin Ldap client and is communicating with a Ldap server. now having a... Read More
What is meant by flickering?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Suppose server object is not loaded into the memory, and the client requests for it, what will happen
Added on Wed, Dec 30, 2009
If a server object is not loaded in the memory and the request for it comes, then the server object is loaded in to the memory and is initialized. Read More
How do u create objects at runtime?
Added on Wed, Dec 30, 2009
we can create object at runtime using object using class.forname.using class.forname we can load specific class and after that we can create a instance of that class using newInstance method. Read More
What is the use of JRE and jar files. what is different between JRE and jar files.
Added on Wed, Dec 30, 2009
JRE stands java runtime invironment. JAR file is a compressed java file. Read More
What are session variable in Servlets?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What are virtual functions?
Added on Wed, Dec 30, 2009
virtual function can be understood only from a design viewpoint. Virtual means existing inappearance but not in reality.When virtual function are used , aprogram that appears in reality be calling a function of a different class Read More
If you have truncated using JDBC, How can you know that how much data is truncated?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
How many threads will be created for a java program, when it is compail & run? and what are they?
Added on Wed, Dec 30, 2009
Program threads are not created at compilation and at the time of execution of java program. Thread.activeCount() gives the no. of active threads. Read More
What is Difference between AWT and Swing?
Added on Wed, Dec 30, 2009
AWT: Abstract window toolkit(AWT) is a non-peerbased technology.The AWT components fully dependent on the underlaying platform. SWING: Swing is a not replacement technology of AWT.But swing allows u lightweight components with peerbased technology... Read More
Why do you create interfaces, and when MUST you use one?
Added on Mon, Dec 28, 2009
You would create interfaces when you have two or more functionalities talking to each other. Doing it this way help you in creating a protocol between the parties involved. Read More
Why Java is not fully object oriented?
Added on Mon, Dec 28, 2009
Java is not a fully object oriented language because it does not support multiple inheritance directly.But it does so by using theconcept of interfaces. A language is said to be fully object oriented if it supports classes,objects,inheritance and... Read More
What is Singleton class?
Added on Mon, Dec 28, 2009
Singleton class is a class whose only one object can be created at a time. - To achieve this one method is that we make its constructor private and provide a static method that returns its instance. When a Singleton class is garbage - collected... Read More
Access specifiers: "public", "protected", "private", nothing?
Added on Mon, Dec 28, 2009
Public : Any other class from any package can instantiate and execute the classes and methods. Protected : Only subclasses and classes inside of the package can access the classes and methods. Private : The original class is the only class allowed... Read More
Are constructors inherited?Can a subclass call the parent's class constructor?When?
Added on Mon, Dec 28, 2009
You cannot inherit a constructor. That is, you cannot create a instance of a subclass using a constructor of one of it's superclasses. One of the main reasons is because you probably don't want to overide the superclasses constructor,... Read More
Why Java is case sensitive?
Added on Mon, Dec 28, 2009
Java is multi platform-> Platform Independent Language, so its used widely in very big softwares or games where multiple variables needed. To Differentiate among that huge no of variables,,Java is Case Sensitive. Read More
What is the difference between InputStream/Outputstream classes?
Added on Mon, Dec 28, 2009
InputStream and its sub classes are used for reading data in the form of streams. Ex : FileInputStream, DataInputStream OutputStream and its sub classes are used for writing data in the form of streams. Ex: FileOutputStream, DataOutputStream... Read More
Can I execute or call one applet from another applet? If so then how??? Please Reply me...
Added on Mon, Dec 28, 2009
Yes, we can call a application from another application for example in a web application we can call a document and read the data from it like that we can call some other aplication to run in a action Read More
What is package? Define with example?
Added on Mon, Dec 28, 2009
package is a grouping of related types providing access protection and name space management. Note that types refers to classes, interfaces, enumerations, and annotation types. Enumerations and annotation types are special kinds of classes and... Read More
What is the difference between Hashmap and Hashtable?
Added on Mon, Dec 28, 2009
All the Mehods in HashTable are synchronized whereas HashMap is not thread-safe. Another big difference is that HashMap allows null key and null values whereas HashTable does not permit null key and null values. Submitted by Bikramjit Bardhan ... Read More
How to make application thread-safe ?
Added on Mon, Dec 28, 2009
You should use the word synchronized to mark the critical section of code. You may also use other methods of thread synchronization (see wait(), notify(), notifyAll() etc. Read More
Why we can not override static method?
Added on Mon, Dec 28, 2009
We CaNNOT override a static method. See a static method has nothing to do with the instance of the class. So when u r using a static method using .(dot) it actually subsitutes the class name. Inheritance is a concept based on instances. So when... Read More
What are the main differences between
Added on Mon, Dec 28, 2009
Question : What are the main differences between jdk1.4 n jdk1.5? Answers: Jdk1.4 doesn't contain the tool interface that is JVMTI which is a profiling tool in jdk1.5.The earlier versions of java had... Read More
Difference: Java Beans, Servlets
Added on Mon, Dec 28, 2009
java bean is a reusable component,where as the servlet is the java program which extends the server capability Read More
What is difference between & and && in java
Added on Mon, Dec 28, 2009
Single Ampercent (& ) can be used as Bitwise operator and Boolean logical operator. Now the difference arises when & is used as logical operator. This can be best explained with the help of an example. int i=5; if(i<3 & i++ ... Read More
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy
Added on Mon, Dec 28, 2009
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented. Read More
what is the definition of arraylist? plz write in brief.
Added on Mon, Dec 28, 2009
ArrayList is an array that grows dynamicaly when needed. In Java an array is of fixed length. Once the array is created the user needs to know the length of the array as to operate with it since the array cannot grow nor can be reduced in size.... Read More
Can I create final executable from Java?
Added on Mon, Dec 28, 2009
yes u can create executable for java just download install4j and use it Read More
What is final method
Added on Mon, Dec 28, 2009
Final method: Final method is a method ,which cannot be overridden in the sub classes. Read More
What is the difference between Serializalble and Externalizable interface?
Added on Mon, Dec 28, 2009
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... Read More
Explain 2 tier and 3 -tier Architecture?
Added on Mon, Dec 28, 2009
JDBC supports both ?two tier: ( client server configuration) ?three- tier model: commands are sent to a middle tier , which then send SQL statements to the database. The database processes the SQL statements and sends the result back to the... Read More
Explain Java security model
Added on Mon, Dec 28, 2009
In java, we have Sand box Security Model. Some Features Structured Memory Access(No Pointer Arithematics) Type-safe reference casting Automatic garbage collection Array bound Checking Checking references for null Read More
In Java, You can create a String object as:
Added on Mon, Dec 28, 2009
Question : In Java, You can create a String object as: String str = " abc"; & String str = new String("abc"); Why cant a button object be created as : Button bt = "abc" Why is it compulsory to create a button object as: Button bt = new... Read More
How is it possible for two String objects with identical values not to be equal under the == operator?
Added on Mon, Dec 28, 2009
The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory. Read More
Why ArrayList is faster than Vector?
Added on Mon, Dec 28, 2009
ArrayList is faster than Vector, because ArrayList is not synchronized. Synchronization will reduce the performance of Vector. Read More
How Linkedlist can be implemeented in java with out using collection frameworks
Added on Mon, Dec 28, 2009
Java(tm) has no user-visible pointers, so how would you do a linked list? Each element needs to point to the next one, doesn't it? Well, fortunately there is a way, illustrated using this brief example: // source file link.java... Read More
What is the difference between an if statement and a switch statement?
Added on Mon, Dec 28, 2009
The if statement is used to select among two alternatives. It uses a boolean expression todecide whichalternative should be executed. The switch statement is used to select among multiplealternatives. It usesan int expression to determine which... Read More
Why "bytecode"? Can you reverse-engineer the code from bytecode?
Added on Mon, Dec 28, 2009
Bytecode is nothing but an optimised set of instructions designed to be executed by JVM . The JVM converts the byte code into specific machine level instructions. Yes,we can reverse engineer the code by using available tools like JAD. EXE Read More
How do you load an Image in a Servlet?
Added on Mon, Dec 28, 2009
It can be done by setting the mime type to the image filepath. For example, ServletContext sc = getServletContext(); String filename = sc.getRealPath("image.gif"); // Get the MIME type of the image String mimeType = sc.getMimeType(filename); ... Read More
explain singleton pattern in java
Added on Mon, Dec 28, 2009
Question : 1-explain singleton pattern in java 2-explain up casting and down casting 3-how do u code a singleton in java 4-How do u read XML file in java 5-gine an example of the Decorator pattern in the java API. 6-What r the... Read More
Diff between ArrayList and Vector?
Added on Mon, Dec 28, 2009
Vector class is Synchronized and ArrayList class is not Synchornized. Submitted by - Rama Krishna ( iamvemuri @ yahoo . com ) Read More
A local inner class may be final or abstract ?
Added on Mon, Dec 28, 2009
The Collection interface provides support for the implementation of a mathematical bag -an unordered collection of objects that may contain duplicates. Read More
What is the diff.between JDK 1.4 and JDK 5.0?
Added on Mon, Dec 28, 2009
The main difference: 1. Generics are introduced in jdk1.5 2. The concept of Out-boxing and boxing is introduced. Read More
What is the priority of main thread in java?? and why??
Added on Mon, Dec 28, 2009
The 'main()' method in Java is referred to the thread that is running, whenever a Java program runs. It calls the main thread because it is the first thread that starts running when a program begins. Other threads can be spawned from this... Read More
What is Serialization and deserialization?
Added on Mon, Dec 28, 2009
Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects. Read More
How an Hashtable can change the iterator? Can a HashMap change the iterator?
Added on Mon, Dec 28, 2009
Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized... Read More
What is transient variable?
Added on Mon, Dec 28, 2009
A transient variable is not stored as part of its objects persistent state. A transient variable is not stored with its Object; therefore, it is not serialized when the method writeObject( ) is invoked. Submitted by Amit Mathur _________ ... Read More
What happens when a thread cannot acquire a lock on an object?
Added on Mon, Dec 28, 2009
If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available. Read More
Which class is extended by all other classes?
Added on Mon, Dec 28, 2009
The Object class is extended by all other classes. Read More
What is the difference between yielding and sleeping?
Added on Mon, Dec 28, 2009
When a task invokes its yield() method, it returns to the ready state. When a task invokesits sleep()method, it returns to the waiting state. Read More
Can a lock be acquired on a class?
Added on Mon, Dec 28, 2009
The synchronized keyword tells the JVM that the method requires a lock in order to run. The JVM then creates the lock and manages the allocation of the lock to threads during execution. When a thread has the lock for a class, it is the only thread... Read More
Can a double value be cast to a byte?
Added on Mon, Dec 28, 2009
Yes, a double value can be cast to a byte. Read More
What happens when you invoke a thread's interrupt method while it is sleeping or waiting?
Added on Mon, Dec 28, 2009
When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown. Read More
What is the middleware. What is the functionality of Webserver?
Added on Mon, Dec 28, 2009
Middleware: Software that facilitates interoperability by mediating between an application program and a network, thus masking differences or incompatibilities in network transport protocols, hardware architecture, operating systems, database... Read More
What is static variable?
Added on Mon, Dec 28, 2009
A static variable is one that is not removed from memory after creation, even when it goes out of scope. The concept is very similar to that of a global variable, except that while a global variable is accessible from anywhere, a static variable is... Read More
Can a Byte object be cast to a double value?
Added on Mon, Dec 28, 2009
No, an object cannot be cast to a primitive value Read More
What is the difference between a Window and a Frame?
Added on Mon, Dec 28, 2009
The Frame class extends Window to define a main application window that can have a menu bar. Read More
What is a transient variable?
Added on Tue, Dec 29, 2009
A transient variable is a variable that may not be serialized. If you don't want some field not to be serialized, you can mark that field transient or static. Read More
What is the difference between List, Set and Map
Added on Tue, Dec 29, 2009
A Set is a collection that has no duplicate elements. A List is a collection that has an order assoicated with its elements. A map is a way of storing key/value pairs. The way of storing a Map is similar to two-column table. Read More
What do you mean by virtual methods?
Added on Tue, Dec 29, 2009
Virtual methods are used to use the polymorhism feature in C++. Say class A is inherited from class B. If we declare say fuction f() as virtual in class B and override the same function in class A then at runtime appropriate method of the class will... Read More
Can a for statement loop indefinitely?
Added on Tue, Dec 29, 2009
Yes, a for statement can loop indefinitely. For example, consider the following:for(;;) ; Read More
What is the difference between C++ & Java
Added on Tue, Dec 29, 2009
Java does not support typedefs, defines, or a preprocessor. Without a preprocessor, there are no provisions for including header files. Since Java does not have a preprocessor there is no concept of #define macros or manifest constants. However,... Read More
What is serialization?
Added on Tue, Dec 29, 2009
Serialization is the process of converting a set of object instances that contain references to each other into a linear stream of bytes, which can then be sent through a socket, stored to a file, or simply manipulated as a stream of data.... Read More
What is JNI?
Added on Tue, Dec 29, 2009
The JNI is used to write native methods to handle situations when an application cannot be written entirely in the Java programming language such as when the standard Java class library does not support the platform - dependent features or... Read More
What is the Vector class?
Added on Tue, Dec 29, 2009
The Vector class provides the capability to implement a growable array of objects. Read More
What is typecasting?
Added on Tue, Dec 29, 2009
Type casting is used to convert the one data type into another data type.for example lower data type into higher data type vice versa lower to higher means widening higher to lower means narrowing Read More
What value does read() return when it has reached the end of a file?
Added on Tue, Dec 29, 2009
The read() method returns -1 when it has reached the end of a file. Read More
If a variable is declared as private, where may the variable be accessed?
Added on Tue, Dec 29, 2009
A private variable may only be accessed within the class in which it is declared. Read More
What are the problems faced by Java programmers who don't use layout managers?
Added on Tue, Dec 29, 2009
Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing... Read More
How does a try statement determine which catch clause should be used tohandle an exception?
Added on Tue, Dec 29, 2009
When an exception is thrown within the body of a try statement, the catch clauses of thetry statement areexamined in the order in which they appear. The first catch clause that is capable ofhandling the exceptionis executed. The remaining catch... Read More
How are memory leaks possible in Java
Added on Tue, Dec 29, 2009
If any object variable is still pointing to some object which is of no use, then JVM will not garbage collect that object and object will remain in memory creating memory leak Read More
What is JDBC? Describe the steps needed to execute a SQL query using JDBC.
Added on Tue, Dec 29, 2009
The JDBC is a pure Java API used to execute SQL statements. It provides a set of classes and interfaces that can be used by developers to write database applications. The steps needed to execute a SQL query using JDBC: 1. Open a connection to... Read More
Why do we call java until.* package as a framework.
Added on Tue, Dec 29, 2009
The Util package bascially contains Collection as its part. A collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following: Interfaces: These are abstract data types... Read More
What is the difference between List, Set and Map?
Added on Tue, Dec 29, 2009
A. List are collections where 1. Elements are stored in a particular Order 2. Repetitions of elements are allowed B. Sets are collection where 1. Elements are stored in any order (just like pebbles put in a pocket) 2. Repetitions are... Read More
What is the Map interface?
Added on Tue, Dec 29, 2009
Map (in the API reference documentation) is an object that maps keys to values. A map cannot contain duplicate keys: Each key can map to at most one value. The Map interface follows. public interface Map { //Basic operations V put(K key, V... Read More
What is abstract method?
Added on Tue, Dec 29, 2009
Abstract method: It is a method we are unable to provide implementation to that method at the time of writing that method. We will provide implementation to that method in the derived class. eg: paint () is a abstract method,service() ,doGet()... Read More
How many methods in the Externalizable interface
Added on Tue, Dec 29, 2009
There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal(). Read More
What is the difference between a static and a non-static inner class?
Added on Tue, Dec 29, 2009
A non-static inner class may have object instances that are associated with instances ofthe class's outer class. A static inner class does not have any object instances. Read More
What is the SimpleTimeZone class?
Added on Tue, Dec 29, 2009
The SimpleTimeZone class provides support for a Gregorian calendar. Read More
What is garbage collection?
Added on Tue, Dec 29, 2009
Garbage collector: Whenever an object is no longer used in the program,Java reclaims the memory of that an object.It is performed by the Java implicitly,no need to care of it.Finalize() will be called before sweeps the memory of an object by java... Read More
What is the difference between throw and throws clause, explain in programatically
Added on Tue, Dec 29, 2009
Throw is used to throw an exception manually, where as throws is used in the case of checked exceptions, to reintimate the compiler that we have handled the exception. so throws is to be used at the time of defining a method and also at the time of... Read More
What is the difference between preemptive scheduling and time slicing?
Added on Tue, Dec 29, 2009
Under preemptive scheduling, the highest priority task executes until it enters the waitingor dead states ora higher priority task comes into existence. Under time slicing, a task executes for apredefined slice oftime and then reenters the pool of... Read More
What state does a thread enter when it terminates its processing?
Added on Tue, Dec 29, 2009
When a thread terminates its processing, it enters the dead state. Read More
What is the use of Interface
Added on Tue, Dec 29, 2009
Use of Interface: Java doesnot support multiple inheritance directly.So java is not pure oop.Using interfaces java supports multiple inheritance.By using using interfaces code is very easy and simple. _________________ Submitted by Devarathnam... Read More
What is the order of method invocation in an Applet?
Added on Tue, Dec 29, 2009
The order of invocation of Applet is as follows: 1.init() 2.start(); 3.stop(); 4.destroy(); Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What method is used to specify a container's layout?
Added on Tue, Dec 29, 2009
The setLayout() method is used to specify a container's layout. Read More
What are the problems faced by Java programmers who don't use layoutmanagers?
Added on Tue, Dec 29, 2009
Without layout managers, Java programmers are faced with determining how their GUIwill be displayedacross multiple windowing systems and finding a common sizing and positioning thatwill work within theconstraints imposed by each windowing system. ... Read More
what is method declaration,method attributes,method modifiers and parameters
Added on Tue, Dec 29, 2009
Method declaration is a java Statement which contains returntype and method name and arguments in it are optional and ends with a semicolon. Method modifiers are the access modifiers. Read More
How many methods in the Serializable interface?
Added on Tue, Dec 29, 2009
There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable. Read More
What are the Object and Class classes used for?
Added on Tue, Dec 29, 2009
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. Read More
Why does not support multiple Inheritance?
Added on Tue, Dec 29, 2009
Java does not support multiple inheritance directly.Because to avoid the Ambiguty among the classes.But java support multiple inheritance in different way i.e. INTERFACES. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What is the difference between a Vector and an Array. Discuss the advantages and disadvantages of both
Added on Tue, Dec 29, 2009
The vector container class generalizes the concept of an ordinary C array. Like an array, a vector is an indexed data structure, with index values that range from 0 to one less than the number of elements contained in the structure. Also like an... Read More
What is the difference between equals and ==?
Added on Tue, Dec 29, 2009
equals method compares content of the two objects where as "==" does object reference copmparsion Read More
What is final variable?
Added on Tue, Dec 29, 2009
Final variable: Final variable is a variable ,you can't modify it.It is just like "const" variable int c/c++.Final variable must initialialized other wise it leads to compile errors.Final variable can't inherited into derived class. eg:... Read More
How are Java source code files named?
Added on Tue, Dec 29, 2009
A Java source code file takes the name of a public class or interface that is defined within the file. A source code file may contain at most one public class or interface. If a public class or interface is defined within a source code file, then... Read More
Does garbage collection guarantee that a program will not run out of memory
Added on Tue, Dec 29, 2009
How fast objects are created does not affect when they are garbage collected. When the object is dereferenced it becomes available for garbage collection. If the only references to an object are from other objects that themselves are candidates for... Read More
How are this and super used?
Added on Tue, Dec 29, 2009
This is used to refer to the current object instance. super is used to refer to the variablesand methods of thesuperclass of the current object instance. Read More
What is the difference between applet and swing?
Added on Tue, Dec 29, 2009
Difference b/w Swing and Applet: Swing : 1.swing is a peer based cmponent 2.swing components are lightly dependent on underlaying os. 3.swing components will be appear any os unique. 4.to design swing components is very easy. 4.which are... Read More
What are wrapper classes?
Added on Tue, Dec 29, 2009
The wrapper classes are under the java.lang and java.util directories. The wrapper classes are: Double, Integer, Character, and Boolean. Wrapper classes are final and hence cannot be sub classed.. The methods of the wrapper classes are all... Read More
When can an object reference be cast to an interface reference?
Added on Tue, Dec 29, 2009
An object reference be cast to an interface reference when the object implements the referenced interface. Read More
Searching a String?
Added on Tue, Dec 29, 2009
String string = "aString"; // First occurrence. int index = string.indexOf('S'); // 1 // Last occurrence. index = string.lastIndexOf('i'); // 4 // Not found. index = string.lastIndexOf('z'); // -1 Read More
How are the elements of a BorderLayout organized?
Added on Tue, Dec 29, 2009
The elements of a BorderLayout are organized at the borders (North, South, East, andWest) and the center of a container. Read More
What is an object's lock and which object's have locks?
Added on Tue, Dec 29, 2009
An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes... Read More
How are this() and super() used with constructors?
Added on Tue, Dec 29, 2009
this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor. Read More
How many methods do u implement if implement the Serializable Interface?
Added on Tue, Dec 29, 2009
The Serializable interface is just a "marker" interface, with no methods of its own to implement. Read More
Which containers use a border Layout as their default layout?
Added on Tue, Dec 29, 2009
The window, Frame and Dialog classes use a border layout as their default layout. Read More
How will you communicate between two Applets?
Added on Tue, Dec 29, 2009
Applet Communication:By using AppletContext() we can communicate in two applets. _______________________ Submitted by Devarathnam.C, S.V.University, Tirupati (devarathnam@yahoo.co.in) Read More
What is the Set interface?
Added on Tue, Dec 29, 2009
The Set interface provides methods for accessing the elements of a finite mathematicalset. Sets do notallow duplicate elements. Read More
What is the difference between Iterator and Enumeration?
Added on Tue, Dec 29, 2009
Enumeration and Iterator both are interfaces present in util package. Enumeration is a legacy interface which does not come under the collection framework, wheras Iterator is an interface present in the collection framework. All the legacy classes... Read More
What is the % operator?
Added on Tue, Dec 29, 2009
It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand. Read More
Why are Java ARchive (JAR) files important?
Added on Tue, Dec 29, 2009
JAR is useful to run setup prog.to install java application on operating system its seems like exe file in windows. Read More
What are 4 drivers available in JDBC?
Added on Tue, Dec 29, 2009
There are four drivers in JDBC. 1.JDBC-ODBC BRIDGE. 2.PARTLY JAVA DRIVER. 3.INTERMEDIATE DATABASE DRIVER(Network purpose). 4.PURE JAVA DRIVER. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
In Java, how are objects / values passed around
Added on Tue, Dec 29, 2009
In Java Object are passed by reference and Primitive data is always pass by value Read More
What do you mean by static methods?
Added on Tue, Dec 29, 2009
By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no... Read More
What is an RMI?
Added on Tue, Dec 29, 2009
RMI: Remote Method Invocation(RMI) is a technology.RMI allows you to invoke the methods in the two different JVM s, which is platform independent and language dependent. _________________ Submitted by Devarathnam.C, S.V.University, Tirupati ... Read More
How many JVM could be run on an operating system. if only one then what is the logical reason
Added on Tue, Dec 29, 2009
one JVM will be consired, since JVM is consider as the JavaByte code interpreter(not specfic to any system o any processor), that will consider the javaprogram and convert in to the Native system call. Read More
Where exactly we make use of Clone objects in a real time?
Added on Tue, Dec 29, 2009
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression: x.clone() != x will be true, and that the expression: x.clone().getClass() =... Read More
Why do threads block on I/O?
Added on Tue, Dec 29, 2009
Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed. Read More
What is the Dictionary class
Added on Tue, Dec 29, 2009
run this file, i think result will itself explain you the use of LOG4J. otherwise mail me ritesh.patni@ gmail.com :- package com.banking.log4j; import org. apache.log4j.*; import com.lnt.banking.constant.ConstantIf; public class... Read More
What is light weight component?
Added on Tue, Dec 29, 2009
Light weight component:Swing is a lightweight component.which are lightly dependent on the underlaying domain. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What synchronization constructs does Java provide? How do they work?
Added on Tue, Dec 29, 2009
You may synchronize a class, a method or a portion of a method. Synchronization will make the code thread safe. Read More
What are the various Collection classes available?
Added on Tue, Dec 29, 2009
Classes which implements different collection interface are:-- HashSet,TreeSet(For Set interface) ArrayList,LinkedList,Vector(for List interface). HashMap,TreeMap (for Map interface). Read More
What is MVC architecture
Added on Tue, Dec 29, 2009
MVC is an approach for developing interactive applications ie it results in events through user interaction.MVC stands for Model View Controller.Model is responsible for holding the application state,view is for displaying the current model and... Read More
For which statements does it make sense to use a label?
Added on Tue, Dec 29, 2009
The only statements for which it makes sense to use a label are those statements that canenclose a break orcontinue statement. Read More
What is Collection?
Added on Tue, Dec 29, 2009
Framework which provides classes and interfaces for holding a group of objects. ? Like Arrays but has more features in terms of flexibility and maintainabiliy ? Consistent, well-defined API for maintaining groups of objects in containers ? A... Read More
How do I instantiate a bean whose constructor accepts parameters using the useBean tag?
Added on Tue, Dec 29, 2009
Consider the following bean: package bar; public class FooBean { public FooBean(SomeObj arg) { ... } //getters and setters here } The only way you can instantiate this bean within your JSP page is to use a scriptlet. For example, the... Read More
What is the main difference between access modifiers and access specifiers?
Added on Tue, Dec 29, 2009
Access specifiers are public,private,protected,default were access modifiers are static,final,abstact,transient,synchronized and volitale Read More
what is the first statement in construtor?
Added on Tue, Dec 29, 2009
The first statement of the constructor should be either a call to super() or this(). ex. class A{ A(){ super(); / this(); } } Read More
What it the root class for all Java classes?
Added on Tue, Dec 29, 2009
Object is the root class for all java classes. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class.
Added on Tue, Dec 29, 2009
Question : I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class. 2. Statement is an interface.... Read More
What is native method
Added on Tue, Dec 29, 2009
A native method is a method that is implemented in a language other than Java Read More
What is the difference between Hashmap and Hashtable
Added on Tue, Dec 29, 2009
Hashmap can contains null values as the keys and as well as values.But Hashtable dose not allow null values as keys and values. hashtable is syncroniged.hashmap is not syncroniged.hashtable can change the iterator. Read More
What is the difference between Process and Threads?
Added on Tue, Dec 29, 2009
Process is a program in execution whereas Thread is a separate path of execution. Read More
What is the use of Servlets?
Added on Tue, Dec 29, 2009
servlet is serverside programming.when client send request to sever then by using servlet server try to response to client. Read More
What is the difference between the JDK 1.02 event model and the event delegation model introduced with JDK 1.1?
Added on Tue, Dec 29, 2009
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (orbubbled up to) the component's... Read More
What is the meaning of "final" keyword?
Added on Tue, Dec 29, 2009
Final keyword is used for define constant variables and method and no body can change that variable and method within program. Read More
Under what conditions is an object's finalize() method invoked by the garbage collector?
Added on Tue, Dec 29, 2009
The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable. Read More
What is the Vector class
Added on Tue, Dec 29, 2009
Vector implements a dynamic array at run tme and it works as arraylsi,but it is synchronizedand not part of the collection framework Read More
What is the difference between applet and application?
Added on Tue, Dec 29, 2009
Difference b/w Applet and Application: Applet : 1.Applet is a small java program,which is executed in the special browser. 2.Applet should not contain main () method. 3.Applet travel in the internet. Application: 1. Application is... Read More
What is the relationship between an event-listener interface and an event adapterclass?
Added on Tue, Dec 29, 2009
An event-listener interface defines the methods that must be implemented by an event handler for aparticular kind of event. An event adapter provides a default implementation of an event listener interface. Read More
How would you keep track of a session
Added on Tue, Dec 29, 2009
In servlets, session can be tracked using a) URL rewriting b) Hiddin FormField c) cookies and d) HttpSession API In EJB to maintain session go for stateful session beans. Read More
What is the difference between final, finally and finalized?
Added on Tue, Dec 29, 2009
final" is a modifier in java.You can use "final" key word for classes, methods and variables. "finally" ,it is a block in exception handling, whatever u write in that block that would be executed 100% irrespective of the exception. "finalize()" This... Read More
What is the functionality of try, catch and finally blocks?
Added on Tue, Dec 29, 2009
In the context of "exception handling" "try", "catch", "finally", "thow" and" throws" plays an anologous role in the java programming language. "try": This block will throw an exception. "catch": This block will catch an exception that is raised in... Read More
What is the life cycle of an applet?
Added on Tue, Dec 29, 2009
Applet life cycle: An Applet is a small java program,which is executed in the special browser(like appletviewer) the lifecycle of an applet is as follows: 1.init(); 2.start(); 3,stop(); 4.destroy(); The init(),and destroy() methods... Read More
In Java, You can create a String object as: String str = "abc"; & String str = new String("abc");Why
Added on Tue, Dec 29, 2009
string x="abc" string y ="abc" i dont think that here they refer to same object.I have refer the complete reference..automatically when u asign stringz like this ..different objects will b created Read More
String class can be extendable? and why?
Added on Tue, Dec 29, 2009
No.String class cannot be extened as it is final class. Read More
What is anonymous class?
Added on Tue, Dec 29, 2009
An anonymous class is a local class that has no name.. An anonymous class is never abstract. An anonymous class is always an inner class; it is never static. An anonymous class is always implicitly final. Read More
What is static class?
Added on Tue, Dec 29, 2009
static class means the class which has all static methods in it.This makes us not to create the object to call the methods in it.we can directly call the methods in it by using ClassName.methodName() Read More
What is the difference between Applet and japplet?
Added on Tue, Dec 29, 2009
Question : What is the difference between Applet and japplet? What are the traverses in binary tree? Write down how will you create a Binary tree? What is constructor and virtual function? Can we call a virtual function in a constructor?... Read More
Connecting to a Database and Strings Handling?
Added on Tue, Dec 29, 2009
Constructing a String If you are constructing a string with several appends, it may be more efficient to construct it using a StringBuffer and then convert it to an immutable String object. StringBuffer buf = new StringBuffer("Initial Text"); // ... Read More
What is the sweep and paint algorithm
Added on Tue, Dec 29, 2009
The painting algorithm takes as input a source image and a list of brush sizes. sweep algo is that it computes the arrangement of n lines in the plane ... a correct algorithm, Read More
What is the Dictionary class?
Added on Tue, Dec 29, 2009
The Dictionary class provides the capability to store key-value pairs. Read More
What method is invoked to cause an object to begin executing as a separatethread?
Added on Tue, Dec 29, 2009
The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread. Read More
What are synchronized methods and synchronized statements?
Added on Tue, Dec 29, 2009
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized... Read More
What is the ResourceBundle class?
Added on Tue, Dec 29, 2009
The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program's appearance to the particular locale in which it is being run. Read More
Write the Java code to declare any constant (say gravitational constant) and to get its value.
Added on Tue, Dec 29, 2009
Class ABC { static final float GRAVITATIONAL_CONSTANT = 9.8; public void getConstant() { system.out.println("Gravitational_Constant: " + GRAVITATIONAL_CONSTANT); } } Read More
How to create .xsl by using java?
Added on Tue, Dec 29, 2009
import java.io.*; class FileOutputDemo { public static void main( String args[]) { FileOutputStream out; // declare a file output object PrintStream p; // declare a print stream object try { // Create a new file output stream //... Read More
Name four methods every Java class will have.
Added on Tue, Dec 29, 2009
public String toString(); public Object clone(); public boolean equals(); public int hashCode(); Read More
How can we invoke private method using refleciotn API(AccessibileObject class)?
Added on Tue, Dec 29, 2009
You can not access the private method of a class by reflection. Read More
What is the difference between synchronized block and normal block ?
Added on Tue, Dec 29, 2009
A synchronized block is a thread safe block which means it cant be accessed by more than one object at a time. It is accessed by objects in a queue on a priority basis.So it can be used to make data integrity. While a normal block can be accessed... Read More
Explain variable shadowing with example?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What are abstract classes, abstract methods?
Added on Tue, Dec 29, 2009
Simply speaking a class or a method qualified with "abstract" keyword is an abstract class or abstract method. You create an abstract class when you want to manipulate a set of classes through a common interface. All derived-class methods that match... Read More
Describe, in general, how java's garbage collector works?
Added on Tue, Dec 29, 2009
The Java runtime environment deletes objects when it determines that they are no longer being used. This process is known as garbage collection. The Java runtime environment supports a garbage collector that periodically frees the memory used by... Read More
What is the use of voltile specifier
Added on Tue, Dec 29, 2009
Volatile modifier applies to variables only and it tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program. Read More
How can i call parameterized constructor if am instantiating a object using "Class.forName("Abc").newInstance()"?
Added on Tue, Dec 29, 2009
We can do by the reflection mechanism. For example here is the code. TestConstructor testConstructor; // This is my class which i want to call. For arguments of construtor. Class[] args = new Class[] {String.class} // specify the type of... Read More
How can you push data from an Applet to Servlet?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
write classes/methods to calculate the total
Added on Tue, Dec 29, 2009
Question : write classes/methods to calculate the total length of a set of lines given the start and end points taking into account overlapping. E.g. Line 1 start: -1.4, end: 3.2 Line 2 start: 2.9, end: 4.1 etc.. Total... Read More
what will this print
Added on Tue, Dec 29, 2009
Question : what will this print int i=10000 System.out.println(i*i); and explain why ? Answers: If we write program as...class First{public static void main(String s[]){ int i=10000System.out.println(i*i);}}It will... Read More
What is it reflection (introspection) ? Why is reflection possible in the Java language?
Added on Tue, Dec 29, 2009
Reflection (introspection) is querying a class about its properties, and operating on methods and fields by the name for a given object instance. Reflection is possible in the Java language because of late binding. Read More
What is a tagged interface?
Added on Tue, Dec 29, 2009
We use tagged interface to indicate compiler or runtime to do some activity in our behalf like we use serializable interface to indicate that a particular class can be serialized. Read More
what happens if i do this=null?
Added on Tue, Dec 29, 2009
Question : what happens if i do this=null? 2)how to swap 2 variables without using third temp variable in java? 3)constructors can not be inherited,why Answers: 1.It shows compile time error when we make this=null i.e... Read More
Why multiple inheritance using classes is disadvantage in java
Added on Tue, Dec 29, 2009
First of all class doesnot support multiple inheritance consider class A as superclass class B and C are sub class of A.comment : class cannot extend more than one class think class D extends B and cthe method present in class A,B,C are alike if u... Read More
Is "abc" a primitive value?
Added on Tue, Dec 29, 2009
The String literal "abc" is not a primitive value. It is a String object. Read More
What is the capacity of Hashtable()?
Added on Tue, Dec 29, 2009
The initial size of the hash table is 11. and the load factor is 0.75.if it reach the bound(i.e. 11*0.75=8) then its doubled the size ie 16. like that it keep on increase its size up to RAM size Read More
What is the serialization?
Added on Tue, Dec 29, 2009
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. Read More
What is the purpose of finalization?
Added on Tue, Dec 29, 2009
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. Read More
When is the finally clause of a try-catch-finally statement executed?
Added on Tue, Dec 29, 2009
The finally clause of the try-catch-finally statement is always executed unless the thread of execution terminates or an exception occurs within the execution of the finally clause. Read More
What is the difference between an Applet and an Application?
Added on Tue, Dec 29, 2009
1. Applets can be embedded in HTML pages and downloaded over the Internet whereas Applications have no special support in HTML for embedding or downloading. 2. Applets can only be executed inside a java compatible container, such as a browser or... Read More
How can you load DLL files when your java class is loading first time ?
Added on Tue, Dec 29, 2009
you can declare a static method(member method) inside which you can use System.loadLibrary(String LibraryName).The code below might help you(though i have not used it). code: public class xxxx { static void loadLib() { System... Read More
What is casting?
Added on Tue, Dec 29, 2009
There are two types of casting, casting between primitive numeric types and casting between objectreferences. Casting between numeric types is used to convert larger values, such asdouble values, tosmaller values, such as byte values. Casting between... Read More
What is Log4j in java
Added on Tue, Dec 29, 2009
Log4j is the property file where you can assign the current application mode in"DEBUG", "INFO", "ERROR", "WARN" etc.sO at the time of running the application you can see "DEBUG" , "ERROR", etc. related messages in Tomcat Webserver. Read More
What is the difference between the paint() and repaint() methods?
Added on Tue, Dec 29, 2009
The paint() method supports painting via a Graphics object. The repaint() method is usedto cause paint() tobe invoked by the AWT painting thread. paint() method can only be called only once in a program directly.. repaint() method can be... Read More
Why we have used to in main method in JAVA this words
Added on Tue, Dec 29, 2009
The "public" keyword is an access specifier,which allows the programmer to control the visibility of class members. When a class member is preceded by "public",then that member may be accessed by code outside the class in which it is declared. In... Read More
What is the differences between script language and programming language?
Added on Tue, Dec 29, 2009
Teh persn u ask.evr1 has different idea. msot aggree taht " scripting languages" are "compiled" real time, while " programming lagnuages" are compiled ahed of time.But it is not alwas tht clear cut. U can get a C "scrpting engine", or u cn get a... Read More
Can u kill thread manually. What is the disadvantage
Added on Tue, Dec 29, 2009
You can stop (kill) a thread by calling the method 'stop()' on the thread object. But it is not preferable to kill a thread, because it may cause system failure when writing to important data structures. Read More
Can we make construtor STATIC?
Added on Tue, Dec 29, 2009
You cannot make a constructor as STATIC, because if you use any access modifier in constructor compiler interprets it to be a method and expects a return type this class will not compile until you specify a return type, since compiler thinks it to... Read More
Does a class inherit the constructors of its superclass?
Added on Tue, Dec 29, 2009
A class does not inherit constructors from any of its superclasses. Read More
How does multithreading take place on a computer with a single CPU?
Added on Tue, Dec 29, 2009
The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially. Read More
What is the difference between the Boolean & operator and the && operator
Added on Tue, Dec 29, 2009
There is no such thing as a "Boolean &" operator. The & operator is the bitwise-AND operator, and combines two values. It's often used for masking off part of a variable (e.g., to get the two low-order bytes of a 32-bit value, use the... Read More
Threading : - How can you pass data between two threads?
Added on Tue, Dec 29, 2009
It is very simple. Get the data that has to be passed from one thread. Set the data in a global variable. now get the data from the glo bal variable !! It is one of the easiest questions i have ever heard ! Read More
What are the traverses in Binary Tree?
Added on Tue, Dec 29, 2009
.PREORDER (root-left-right) 2.INORDER (left-root-right) 3.POSTORDER. (left-right-root) and converse of above. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What is polymorphism?
Added on Tue, Dec 29, 2009
Polymorphism:The ability to take more than one form. eg: int area(int a,int b); int area(int a,int b,int c); Here function "area()"is same but it will performs different tasks depending on passing different arguments. Submitted by... Read More
What is it object serialization?
Added on Tue, Dec 29, 2009
Object serialization is the process of saving an object's state to a sequence of bytes, as well as the process of rebuilding those bytes into a live object at some future time. To persist an object in Java, we must have a persistent object.... Read More
What are the differences between Java & C++ in terms of its features?
Added on Tue, Dec 29, 2009
Features:-===========================================<font face=verdana size=10><center><TABLE border=0 cellPadding=0 cellSpacing=0 width="70%"><TR><TD><STRONG>Topic</STRONG></TD><TD><STRONG>... Read More
Please give me answer why we use Interface though it contain only blank implementation
Added on Tue, Dec 29, 2009
When we r implementing the some comman methods in the every class at that time we keep that all methods in the one interface. Another way example:- for example for CD Writer soft ware dovelepment all companies(LG,SAMSUNG) follow the method names r... Read More
Which arithmetic operations can result in the throwing of anArithmeticException
Added on Tue, Dec 29, 2009
Integer / and % can result in the throwing of an ArithmeticException. Read More
What is the purpose of garbage collection?
Added on Tue, Dec 29, 2009
The purpose of garbage collection is to identify and discard objects that are no longerneeded by a programso that their resources may be reclaimed and reused. Read More
What is JFC?
Added on Tue, Dec 29, 2009
JFC stands for Java Foundation Classes. It is more like an extension to the API's which was available in JAVA. It was implemented and released in 1998 ( im not very sure abt the date though ) In simpler terms it consists of the API'... Read More
Why cant we compare two objects with ==,why we should use only .equals() for objects.
Added on Tue, Dec 29, 2009
"==" is called the "Object Reference Equality" & "equals()" method is called the "Object Value equality". Object1 == Object2; In above == checks if both reference variables, Object1 & Object2 refers to the same object. If it does... Read More
Why are the methods of the Math class static?
Added on Tue, Dec 29, 2009
So they can be invoked as if they are a mathematical code library. Read More
What is the command to know which version of java you are using?
Added on Tue, Dec 29, 2009
java -version command will return the installed java version. Read More
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Added on Tue, Dec 29, 2009
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set usesonly 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16,and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns. Read More
Given a text file, input.txt, provide the statement required
Added on Tue, Dec 29, 2009
public class readAFile{ public static void main(String args[]) { try{ FileInputStream fis = new FileInputStream("Input.txt"); int i = 0; do{ i = fis.read(); if(!=-1){ System.out. print((char)i); } }while(i!=-1); }catch(Exception ex){ ... Read More
What are virtual functions
Added on Tue, Dec 29, 2009
Functions which are called at runtime are known as virtual functions. Virtual functions are used to encorporate runtime polymorphism or in other words dynamic binding. Read More
In what situations we can use innerclass and anonymous classSSS
Added on Tue, Dec 29, 2009
A class with in the class is called innerclass.it is a safety mechanisam.innerclass variables are accessed througth outerclass variables only. anonymous class is an innerclass whose class name will be hidden .whom will be created only object. Read More
What is autoboxing?
Added on Tue, Dec 29, 2009
As any Java programmer knows, you can?t put an int (or other primitive value) into a collection. Collections can only hold object references, so you have to box primitive values into the appropriate wrapper class (which is Integer in the case of... Read More
What are the differences between ArrayList and a Vector
Added on Tue, Dec 29, 2009
ArrayList will grow half the size what you initialise ..where as vector will grow doble the initial size.. Read More
What is the purpose of the System class? S
Added on Tue, Dec 29, 2009
The purpose of the System class is to provide access to system resources. Read More
Would you like to derive data from a base class
Added on Tue, Dec 29, 2009
Some times, If the variable is global for a packege. Read More
How would you pass a java integer by reference to another function
Added on Tue, Dec 29, 2009
Create a wrapper class Integer of int. Now u can pass the Integer class by reference. Read More
WHAT IS THE DIFFERENCE BETWEEN MULTI-THREADING AND MULTI-PROCESSING?
Added on Tue, Dec 29, 2009
Multitasking is running several processes at a time. Multi threading runs several threads of a single process at a time.The priority levels of threads are from 1-10.Normal priority comes to 5. Multi threading is normal in any window environment,... Read More
Can an object's finalize() method be invoked while it is reachable?
Added on Tue, Dec 29, 2009
An object's finalize() method cannot be invoked by the garbage collector while the objectis still reachable.However, an object's finalize() method may be invoked by other objects. Read More
What is the List interface?
Added on Tue, Dec 29, 2009
The List interface provides support for ordered collections of objects. Read More
Can an abstract class be final?
Added on Tue, Dec 29, 2009
An abstract class may not be declared as final. Read More
How is serialization implemented in Java
Added on Tue, Dec 29, 2009
A particular class has to implement an Interface java.io.Serializable for implementing serialization. Read More
What are 4 drivers available in JDBC
Added on Tue, Dec 29, 2009
There 4 drivers available in java they are JDBC-ODBC bridge driver Native API partly java driver JDBC Net pure java driver Native protocol pure java driver Read More
What is a void return type?
Added on Tue, Dec 29, 2009
A void return type indicates that a method does not return a value. Read More
Have you ever used HashTable and Dictionary?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
And What situation , each of the 4 drivers used?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the main functionality of the Prepared Statement
Added on Tue, Dec 29, 2009
Prepared statement is a precomplie SQL statement.It is the compiled version of the query.Prepared statement has got a faster excecution time than any other statement Read More
What is the difference between Enumeration and Iterator?. When i can use Enumeration and when i can use iterator?. Can any one tell me the situation that only Enumeration could able to solve that problem and vice versa.
Added on Tue, Dec 29, 2009
1. Difference between Enumeration and Iterator interface is Enumeration has two methods hasMoreElements() and nextElement() and Iterator has three methods hasNext() and next() and remove(). 2. Whatever we can achieve with Enumeration we can... Read More
What is the purpose of interface? And tell the difference between the class and interface?
Added on Tue, Dec 29, 2009
The interface supports multiple Inheritance .with one reference we can call all methds of interface witch was implemented in all classes. Read More
What are E and PI?
Added on Tue, Dec 29, 2009
E is the base of the natural logarithm and PI is mathematical value pi. Read More
When is update method called?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the perfect definition of an Adapter class, explain with an example
Added on Tue, Dec 29, 2009
The addpter pattern converts the interface of a class into another interface the client expect. Adapter lets classes work together that could't otherwise because of incompatible interface Read More
How can u move/drag a component placed in Swing Container?
Added on Tue, Dec 29, 2009
Thanks in advance.i want to move a JButton using Mouse in runtime within a JFrame.saran Read More
What classes of exceptions may be thrown by a throw statement?
Added on Tue, Dec 29, 2009
A throw statement may throw any expression that may be assigned to the Throwabletype. Read More
What is internationalisation? How can you achieve in java?
Added on Tue, Dec 29, 2009
Internationalization is the process of designing an application so that it can be adapted to various languages and regions without engineering changes. Sometimes the term internationalization is abbreviated as i18n, because there are 18 letters... Read More
I want to create two instances of a class ,But when trying for creating third instance it should not allow me to create . what i have to do for making this?
Added on Tue, Dec 29, 2009
i dont think it is directly possible thru any methods. u can use a static avriable to achive this. go thru following code: public class test1 { static int cntr=0; test1() { cntr++; if(cntr>2) throw new NullPointerException();//u can define a new... Read More
What are the services in RMI?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is abstract method
Added on Tue, Dec 29, 2009
abstract method are the methods that have no implementation of its self(i.e by superclass).they do not have body.so the subclass have to override them . Read More
What an I/O filter?
Added on Tue, Dec 29, 2009
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in someway as it is passed from one stream to another. Read More
What is the interface of thread?
Added on Tue, Dec 29, 2009
Thread can be used in two ways 1.By implementing Runnable interface 2.By Extends Thread class Read More
How are the elements of a GridLayout organized?
Added on Tue, Dec 29, 2009
The elements of a Grid layout are of equal size and are laid out using the squares of a grid. Read More
What are the legal operands of the instanceof operator?
Added on Tue, Dec 29, 2009
The left operand is an object reference or null value and the right operand is a class,interface, or array type. Read More
In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between Application server and Web Server
Added on Tue, Dec 29, 2009
Taking a big step back, a Web server serves pages for viewing in a Web browser, while an application server provides methods that client applications can call. A little more precisely, you can say that: A Web server exclusively handles HTTP... Read More
How to use C++ code in Java Program?
Added on Tue, Dec 29, 2009
C and c++ methods can be used as native methods,but you need to load the class before that as a library! Read More
What state is a thread in when it is executing?
Added on Tue, Dec 29, 2009
An executing thread is in the running state. Read More
What is JDBC. How do you connect to the Database?
Added on Tue, Dec 29, 2009
jdbc is a java database connectivtiy is given by sun microsystemdriver the code is: import java.sql.*; Class.forName("sun.jdbc. odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("domain name: subdomain:db name"); Read More
What is JDBC. How do you connect to the Database
Added on Tue, Dec 29, 2009
JDBC: Java DataBase connectivity. By using the JDBC-ODBC driver we can connect to the database Read More
What are interfaces? or How to support multiple inheritance in Java?
Added on Tue, Dec 29, 2009
An interface is a specification that exists between software components that specifies a selected means of interaction, by means of properties of other software modules, which abstract and encapsulate their data. Java does not support multiple... Read More
What is the use of Servlets
Added on Tue, Dec 29, 2009
They handle web requests, returning data or HTML programmatically rather than from a static file. They can access databases, perform calculations, and communicate with other components such as Enterprise JavaBeans. Read More
Why Java is not 100% pure object oriented language?
Added on Tue, Dec 29, 2009
Pure Object Oriented is that use principally the terms like: encapsulation, polymorphism, dynamic-binding.If you think Object Oriented means then can understand what these terms means.I'll tell you only that java can "extends" and "implements"... Read More
How do you communicate in between Applets & Servlets?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How is it possible for two String objects with identical values not to be equal under the ==operator?
Added on Tue, Dec 29, 2009
The == operator compares two objects to determine if they are the same object inmemory. It is possible for two String objects to have the same value, but located in different areas of memory. Read More
Explain RMI Architecture?
Added on Tue, Dec 29, 2009
RMI, Remote Method Invocation is an alternate to RPC, used to invoke the methods (often called as Services) provided by an object of One JVM in another JVM. This is the Remoting Technology that is supported by Java. This technology can be... Read More
What is the command to know which version of java you are using
Added on Tue, Dec 29, 2009
If you have set up your path correctly, you can type the following at the command prompt: java -version Read More
What is the difference between C++ & Java?
Added on Tue, Dec 29, 2009
Both apply OOPS. but Java adopts byte code conversion whereas c++ does not. c++ supports destructors whereas Java doesn't support. c++ uses pointers but Java doesn't.....so more secure.... Multiple inheritance can be possible in c+... Read More
When to use Interface over abstract class?
Added on Tue, Dec 29, 2009
Abstract classes are designed with implemantion gaps for sub-class to fill in. interfaces are sintacticlly similar to classes but they lack insance variables & methods. abstract classes can also have both abstract methods & non-abstract... Read More
What is the relationship between a method's throws clause and the exceptionsthat can bethrown during the method's execution?
Added on Tue, Dec 29, 2009
A method's throws clause must declare any checked exceptions that are not caught within the body of the method. Read More
What is user defined exception?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the diffrence between an Abstract class and Interface
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Difference: AWT, Swing
Added on Tue, Dec 29, 2009
AWT is the AbstractWindowToolkit.AWT is the heavy weight component,why Because It hides the peers component to the user.in AWT 2 instances are created,it hides to user.where as swings are the light weight component.it wont create peers component. Read More
What class allows you to read objects directly from a stream?
Added on Tue, Dec 29, 2009
The ObjectInputStream class supports the reading of objects from input streams. Read More
What are the modules in a J2EE application?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between overloading and overriding
Added on Tue, Dec 29, 2009
Overloading: The same method name with a different signature (generally input argument list) written in the same class. Overriding: The identical method signature from a parent (super) class written in a subclass and modification of the method... Read More
What class of exceptions are generated by the Java run-time system
Added on Tue, Dec 29, 2009
The Java runtime system generates RuntimeException and Error exceptions. Read More
What are the tiers in J2EE architecture?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
How will you add panel to a Frame
Added on Tue, Dec 29, 2009
Get the frames contentpane and add the panel frame.getContentpane().add(panel); Read More
What is the difference between a Choice and a List?
Added on Tue, Dec 29, 2009
A Choice is displayed in a compact form that requires you to pull it down to see the listof availablechoices. Only one item may be selected from a Choice. A List may be displayed in such away that severalList items are visible. A List supports the... Read More
Difference ? Java, C++
Added on Tue, Dec 29, 2009
For ur answer refer to text books, my question here, are session thread safe??, also execute method of the action class is thread safe??, i mean can multiple request process with in the execute method Read More
What is the return type of a program's main() method?
Added on Tue, Dec 29, 2009
A program's main() method has a void return type. Read More
What is the difference between function synchronization and object synchronization?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Meaning - Abstract classes, abstract methods
Added on Tue, Dec 29, 2009
Abstract Class:- it has abstract methods and non-abstract methods. Abstract Methods:- this methods has no body. these final and variables of these methods are static, final and protected. Read More
Can i expand an interface
Added on Tue, Dec 29, 2009
I didn't understand ur question properly. My understanding is by expand you mean extend. If I am right, you can extend interfaces in java. It's same as extending classes in Java. Read More
What is class loaders
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why JAVA not support multiple inheritance? How can we pass address of an object
Added on Tue, Dec 29, 2009
In java first edition there is no multiple inheritance,but later editions they provided indirect multiple inheritance by interfaces and extends. Read More
How do you handle events in Java?
Added on Tue, Dec 29, 2009
you have the better answer, then send it to us. We will display your answer after the approval. Read More
When should i used notify() and notifyall() methods on threads
Added on Tue, Dec 29, 2009
To wakes up the threads which are in waiting stateaddition notes:-notify() wakes up a single thread which is waiting on the object's lock notifyAll() wakes up ALL waiting threads; the scheduler decides which one will run they can only be used... Read More
Whether private,protected method can be overloaded,overrided or not?Tell me reason?
Added on Tue, Dec 29, 2009
We can use access specifier's and we can overload the methods also. but we can't override methods( by changing only access specifier is just like a override.) Read More
How to create the object to the anonomous class
Added on Tue, Dec 29, 2009
Anonymous classes are classes that don?t have a name (hence the term anonymous). Because they don?t have a name, there is no way to refer to them. For this reason, their declaration must be given at creation time, as part of the new statement.That... Read More
Can we add Hashtable/HashMap to a vector?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Which non-Unicode letter characters may be used as the first character of an identifier?
Added on Tue, Dec 29, 2009
The non-Unicode letter characters $ and _ may appear as the first character of an identifier. Read More
Whether a Class,Method can be garbage collected or not?How
Added on Tue, Dec 29, 2009
Class is a programme means set of instructions and method is part of that class whichever is available in. That's why classes and methods are not garbage collected. but it's instance is garbage collected. Read More
Explain the importance of "static"keyword
Added on Tue, Dec 29, 2009
Static keyword ,means only one copy per class if u have a static block or static method it will run first then only other statements like constructor will run . it dosen't need an object to access its method .Though u can access it using object... Read More
How can the Checkbox class be used to create a radio button?
Added on Tue, Dec 29, 2009
By associating Checkbox objects with a CheckboxGroup. Read More
Can some one pls tell me the exact difference between mutable and immutable ?
Added on Tue, Dec 29, 2009
Immutable means unchangeable i.e. U cannot change the content and length of String object. But StringBuffer object is Mutable. i. e. u can change length, content etc.. Let me explain with an example, ??? String s1=new String("Senthil"); ???... Read More
What is the use of keyword transient?
Added on Tue, Dec 29, 2009
Transiate is a access modifier that can not be serialized, Means it is unable to maintain its state.If we declare any varrible as transiate then that varrible is cannot be serialized.We cannot send that data onto the network. Read More
If a method is declared as protected, where may the method be accessed?
Added on Tue, Dec 29, 2009
A protected method may only be accessed by classes or interfaces of the same package orby subclasses ofthe class in which it is declared. Read More
What is the difference between run-time Polymorphism and compile-time Polymorphism?
Added on Tue, Dec 29, 2009
compile time polymorpism also known as staic poly run time polymorpism also known as dynamic polymorpism example for static poly is method overloading example for dynamic poly is method overriding static poly is linking method call at the time of... Read More
Which Collection class is used for FIFO in Java?
Added on Tue, Dec 29, 2009
you have the better answer, then send it to us. We will display your answer after the approval. Read More
What do mean by polymorphism, inheritance, encapsulation?
Added on Tue, Dec 29, 2009
Polymorphism:Behaving differentely at the different placess.Ability to take more than one form.Inhetitance:Aquring the parent properties into child properties.Creating the new class from alredy exiting class.Encapsulation:Wrapping of the methods &... Read More
When does the compiler supply a default constructor for a class?
Added on Tue, Dec 29, 2009
The compiler supplies a default constructor for a class if no other constructors are provided. Read More
What are the various layouts available. What is the difference between them
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
How do you know that where to use abstract class or interface?
Added on Tue, Dec 29, 2009
If we want to implement all the methods in a child class then w e will go for Interface and if we want to implement a few methods , if we want to use a few methods of its super class we go for Abstract class. Read More
Difference b/w synchronized Method and synchronized statement in case of whole body of method cover by synchronized statement.
Added on Tue, Dec 29, 2009
Synchronization hits panelty on performance so when you want to only some portion of you method code synchoronized in that case use synchronized statement in you method. Otherwise if you wish whole your method synchronized use synchronized method. Read More
What are the various ways of creating a thread. What is difference between them?
Added on Tue, Dec 29, 2009
1> Implementing Runnable interface. 2>Extending Thread class. First case we have to override run method of the interface. Read More
What is the basic difference between Java and .Net
Added on Tue, Dec 29, 2009
Java is platform independent but it uses an respective jvms for each platform .Net is also platform independent ie., it works on more than one os but the thing is that those platforms alll belong to windows. The thing that microsoft havent... Read More
What is the use of System.err.println()?, explain clearly what is System.err.println()?, what r the access specifiers available in System class?
Added on Tue, Dec 29, 2009
The standard input, output, and error streams -- System.in, System.out, and System.err -- are all byte streams. You can use System.err.print and System.err.println to write to standard error on to the console. Read More
What is the purpose of the File class?
Added on Tue, Dec 29, 2009
The File class is used to create objects that provide access to the files and directories of alocal file system. Read More
What is the difference between Delegation event model and Inheritance event model?
Added on Tue, Dec 29, 2009
you have the better answer, then send it to us. We will display your answer after the approval. Read More
Difference between wait and notify in java
Added on Tue, Dec 29, 2009
wait() and notify() both extend from object class. wait() -- causes current thread to wait until another thread invokes the notify() or notifyAll() method for this object. notify() -- wakes up a single thread that is waiting on this object'... Read More
What do you meant by private constructor? why somebody declare only private constructor.
Added on Tue, Dec 29, 2009
One can delcare a private constructor for maintining the object creation ... maybe it just wants the object to be created once .... or maybe using a static method such as getInstance() one can give access to constructor which is private....Basically... Read More
What is the difference between static and non-static variables?
Added on Tue, Dec 29, 2009
Difference b/w Static and Non-static variable: Static variable is a variable ,which is not repeated to each and every object .It is shared by all objects .It is also known as Class variable.Static methods only access the static variable.By default... Read More
What is the purpose of using Java Beans? when should we extend JavaBean class?
Added on Tue, Dec 29, 2009
Java Bean is a class which is used to build reusable components.It has no main method.Moreover, it is mainly developed for building GUI components. The variables and methods declared inside the bean class are referred as property. Read More
What interface must an object implement before it can be written to a stream as an object?
Added on Tue, Dec 29, 2009
An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object. Read More
Give example of : High severity & Low priority
Added on Tue, Dec 29, 2009
High severity means a matching high priority, take the example of a bugzilla with a high severity and a low priority. For example, if the defect is a problem that blocks use of a enhancement, but that enhancement is a corner case that has few (if any... Read More
What is super class of an Exception class?
Added on Tue, Dec 29, 2009
Exception itself is a defined class without any super class. Read More
What modifiers can be used with a local inner class?
Added on Tue, Dec 29, 2009
A local inner class may be final or abstract. Read More
What is the difference between importing a class
Added on Tue, Dec 29, 2009
Question : What is the difference between importing a class and creating the object for that class Answers: If there is any class another then in java.lang package(which get imported by default) then we need to import that... Read More
What is the Collection interface?
Added on Tue, Dec 29, 2009
The Collection interface provides support for the implementation of a mathematical bag -an unorderedcollection of objects that may contain duplicates. Read More
If we are having Interface A,Interface B,Interface C and Class D where A,B,C are Base classes and D has extended the features of all the three
Added on Tue, Dec 29, 2009
Question : If we are having Interface A,Interface B,Interface C and Class D where A,B,C are Base classes and D has extended the features of all the three if A,B,C are having totally 5 methods and D has developed only 3 of them what will happen... Read More
What is the Difference between Design Pattern and Architecture? Can any one answer for this plz..
Added on Tue, Dec 29, 2009
Design Pattern meansit states about rules and regulations to be followed while implementing some s/w, whereas architecture states how a particular s/w is to be implemented. Design pattern concentrates on how Architecture concentrates on what Read More
As the Swings have more advantages over the AWT.. Why still in market are they using AWTs??
Added on Tue, Dec 29, 2009
Swings are light wait components than AWT components. Swings are OS independent, having more component in swings than in AWT. Read More
My quetion is about the protected class. it have one super and sub class example ,
Added on Tue, Dec 29, 2009
Question : My quetion is about the protected class. it have one super and sub class example , below example i read from one pdf. package certification; public class Parent { protected int x = 9; // protected access } -------------... Read More
When we are sending the serialized array object thro the network, what is being passed ? is the value or the reference ?
Added on Tue, Dec 29, 2009
Java has only pass by value associated with it. Even when an Object is passed the value of Object reference in the Stack is passed(not the actual Object in Heap) But since the value passed in is a reference to an Object any modification to the... Read More
How are the elements of a GridBagLayout organized?
Added on Tue, Dec 29, 2009
The elements of a GridBagLayout are organized according to a grid. However, the elements are of differentsizes and may occupy more than one row or column of the grid. In addition, the rows andcolumns mayhave different sizes. Read More
What happens if you try to run an executable JAR, and the end-user doesn't have java installed?
Added on Tue, Dec 29, 2009
It will not compile because there is no java virtual machine.even though it is executable jar file it need java virtual machine. Read More
What restrictions are placed on method overriding?
Added on Tue, Dec 29, 2009
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. Read More
whether we can set the time implicitly for the garbage collection?
Added on Tue, Dec 29, 2009
Yes, by using System.gc we can implicitly call the garbage collector Read More
How can a GUI component handle its own events?
Added on Tue, Dec 29, 2009
A component can handle its own events by implementing the required event-listener interface and addingitself as its own event listener. Read More
How to sort String, for example: abced. to change to abcde ?
Added on Tue, Dec 29, 2009
Firstly convert the string into a list of characters and after that compare each character with its precedence(like checking with the character) Read More
What event results from the clicking of a button?
Added on Tue, Dec 29, 2009
The ActionEvent event is generated as the result of the clicking of a button. Read More
Can there ever be more than one program running on a single port? In other words, can two applications on the same server have the same port number?
Added on Tue, Dec 29, 2009
I think we can have two different applications with same name.we can differnciate diffenrent applications by their application names but not with port number.so we can have same port numbers Read More
How do you know the port number of the server program you want to talk to?
Added on Tue, Dec 29, 2009
By using int getServerPort of ServletRequest Interface Read More
Write a program that singleton objects returns two instances?
Added on Tue, Dec 29, 2009
We can use clone() method to create another instance of a singleton class. Example: SingletonObjectClass obj = SingletonObjectClass.createSingletonObject(); SingletonObjectClass clone = (SingletonObjectClass) obj.clone(); java.lang... Read More
What modifiers may be used with an interface declaration?
Added on Tue, Dec 29, 2009
An interface may be declared as public or abstract. Read More
What is the difference between Classpath and Import?
Added on Tue, Dec 29, 2009
Difference b/w the Classpath and Import: Classpath: Class path is a system variable. It is a collection of files in the directories.Normally classpath will be used by Java interpreter to exucute the class files(.class). Import :Import is a... Read More
Why not declare an ArrayList if you want to hold ints?
Added on Tue, Dec 29, 2009
The array list always stores objects, but int is primitive data type, its not object. If you stiil want to store int in arraylist, then you transform [wrap] it in Integer Object and then store it in arraylist. Read More
What restrictions are placed on the values of each case of a switch statement?
Added on Tue, Dec 29, 2009
During compilation, the values of each case of a switch statement must evaluate to avalue that can bepromoted to an int value. Read More
What is the difference between Eventlistener and Eventadapter?
Added on Tue, Dec 29, 2009
EventAdapter classes are implicitly provide the default implementation of all EventListener interfaces.Using these event dapter classes you can implement required methods ,rest of methods you may ignore. Submitted by Devarathnam.C (devarathnam... Read More
Isn't it redundant to have to mark the methods final if the class is final?
Added on Tue, Dec 29, 2009
If a class is marked final it means that the reference to this class cannot be changed and the methods marked final mean that they cannot be overridden Read More
How can we take various inputs from user as int,char,string,float etc ?
Added on Tue, Dec 29, 2009
By using BufferedReader we access parameter as String and by type-casting into it into (Integer.parseInt(variable_name)) int, float, char, double, long etc. U don't get parameter as primitive type use Wrapper classes Read More
What is the difference between Observable and Observer?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why would I want to make a class final? Doesn't that defeat the whole purpose of OO?
Added on Tue, Dec 29, 2009
If u wanna class that should not be extened we can use final class.no is not draw back of oo but is nothing but encapsulation that is going to hide information. Read More
Doesn't the compiler always make a no-arg constructor for you?
Added on Tue, Dec 29, 2009
No. when there is user-defined parametrized constructor, then the compiler will not make a no-arg. constructor. Read More
How does serialization work
Added on Tue, Dec 29, 2009
Synchronisation work with locks. o There is one built-in lock per each java object o If one thread picks up the lock, no other thread can enter the synchronised code. o A method or a code block could be synchonized Read More
Connecting to a Database and Strings Handling
Added on Tue, Dec 29, 2009
Constructing a String If you are constructing a string with several appends, it may be more efficient to construct it using a StringBuffer and then convert it to an immutable String object. StringBuffer buf = new StringBuffer("Initial Text"); // ... Read More
I need your help to answer the code shown below.
Added on Tue, Dec 29, 2009
Question : I need your help to answer the code shown below. using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace ApplicantTestin { /// The DataObject class stored with a key ... Read More
What is the difference between String and StringBuffer
Added on Tue, Dec 29, 2009
String : String is a immutable class.You can't modify it. StringBuffer: StringBuffer is a mutable class .You can modify it. Submitted by Devarathnam.C (devarathnam@yahoo.co.in) Read More
Are there any practical limits on the levels of subclassing? How deep can you go?
Added on Tue, Dec 29, 2009
No.This is No.This is the correct answer. the correct answer. Read More
Searching a String
Added on Tue, Dec 29, 2009
String string = "aString"; // First occurrence. int index = string.indexOf('S'); // 1 // Last occurrence. index = string.lastIndexOf('i'); // 4 // Not found. index = string.lastIndexOf('z'); // -1 Read More
What would happen if you say this = null
Added on Tue, Dec 29, 2009
This=null assigns null value to the current invoking object Read More
Name the eight primitive Java types?
Added on Tue, Dec 29, 2009
The eight primitive types are byte, char, short, int, long, float, double, and boolean. Read More
Does import make my class bigger? Does it actually compile the imported class or package into my code?
Added on Tue, Dec 29, 2009
Import statement doesn't make your class bigger. Why because, importing a class means that to tell the compiler to load the specified class into memory during compilation. If you specify more classes in import statements, your class will take... Read More
What happens in Integer.parseInt() if the thing you pass isn't a number? And does it recognize spelled-out numbers, like "three" ?
Added on Tue, Dec 29, 2009
Integer.parseInt() method throws a NumberFormatException if any data other than the number (within the range of java ?int? data type) is passed as argument, even when we pass spelled-out numbers, like "three". Read More
How are the elements of a CardLayout organized?
Added on Tue, Dec 29, 2009
The elements of a CardLayout are stacked, one on top of the other, like a deck of cards. Read More
What happens if the argument you want ro pass is an object instead of a primitive?
Added on Tue, Dec 29, 2009
In java there is no "pass by reference", we have only "pass by value". When an object reference variable is passed , the value stored inside the reference variable will be passed i.e., the address of the Object that the reference variable points to... Read More
What is the difference between overloading and overriding?
Added on Tue, Dec 29, 2009
Overloading: Overloading is nothing but passing the different parameters to the method. Here method name is same but parameters are different. Overriding: Overriding is nothing but giving the implentation to the method in the derived class.Here... Read More
How big is a reference variable?
Added on Tue, Dec 29, 2009
An object reference variable holds bits that represent a way to access an object, it does not hold the object itself (it actually holds something that works a bit like a pointer to the address at which the object can be found). Read More
Compare SWING components to standard AWT.
Added on Tue, Dec 29, 2009
Swing is an extension of, and not a replacement for the AWT. There is some overlap between AWT and Swing (for example a Swing JButton component might be viewed as an improved functional replacement for an AWT Button component.) One of the advantages... Read More
What is Java Beans ?
Added on Tue, Dec 29, 2009
According to JavaSoft, "A Java Bean is a reusable software component that can be manipulated visually in a builder tool." Read More
What design patterns have you used
Added on Tue, Dec 29, 2009
In Java, what is the difference between Java API & Applets. What is the advantage if a person have Java + LDAP Skills Read More
What is the purpose of finalisation?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the difference between Eclipse3.0 and Jbuilder tool?
Added on Tue, Dec 29, 2009
Elipse 3.0 is an sun microsystems product and it supports plugins. where Jbuilder is product of borland and it does not support plugins. Read More
What you know about Corba implementation in Java ?
Added on Tue, Dec 29, 2009
Java 1.2 promises full CORBA IDL support. Read More
What is Reflection. Uses of Reflection?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Can i know what are methods that a classloader calls when it is loading the class
Added on Tue, Dec 29, 2009
For loading the class class.forName("class name"); It just load the class only. For creating the instance for this class class.forName("class name").newInstance(); One another way for loading the class is ClassLoader. ClassLoader is an... Read More
What do you know about networking support in Java ?
Added on Tue, Dec 29, 2009
Java supports "low-level" and "high-level" classes. "Low-level" classes provide support for socket programming: Socket, DatagramSocket, and ServerSocket classes. "High-level" classes provide "Web programming": URL, URLEncoder, and URLConnection... Read More
What is meant by Tomcat in java and its usage?
Added on Tue, Dec 29, 2009
Tomcat is an extension to webserver. It is a servlet and jsp container. It can serve static and dynamic pages, which can be HTML and JSPs, along with servlets. Read More
What is it object serialization ?
Added on Tue, Dec 29, 2009
Serialization is a way to convert objects (including complex data structures such as lists and trees) into a stream of bytes. Read More
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
Added on Tue, Dec 29, 2009
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented. Read More
If a class is declared without any access modifiers, where may the class be accessed?
Added on Tue, Dec 29, 2009
A class that is declared without any access modifiers is said to have package access. Thismeans that theclass can only be accessed by other classes and interfaces that are defined within the same package. Read More
How can we do bug tracking in an intranet project for a pharmaceutical company using java,jdbc,ejb sevlet using oracle as backend can anyone guide?
Added on Tue, Dec 29, 2009
You can use some open-source bug tracking software like TrackIT (http://trackit.sourceforge.net), Scarab (http://scarab.tigris.org/) or commercial software like Jira (http://www.jira.com) Read More
What is data encapsulation? What does it buy you
Added on Tue, Dec 29, 2009
The most common example I can think of is a javabean. Encapsulation may be used by creating 'get' and 'set' methods in a class which are used to access the fields of the object. Typically the fields are made private while the get... Read More
What is list interface?
Added on Tue, Dec 29, 2009
List is an interface which can be used for stroing the elements in inserting order. It allows to store the duplicate elements. And for acceccing the elements, List provide a seperate iterator called ListIterator. Read More
How can you do multiple inheritance in Java
Added on Tue, Dec 29, 2009
Muliple inheritance is done with the help of interfaces interfaces Read More
What is the relationship between an event-listener interface and an event-adapter class?
Added on Tue, Dec 29, 2009
An event-listener interface defines the methods that must be implemented by an event handler for a particular kind of event. An event adapter provides a default implementation of an event-listener interface. Read More
What are the main differences between Java and C++?
Added on Tue, Dec 29, 2009
Java vs C++ 1) C++ supports pointers whereas Java does not 2) C++ supports operator overloading,multiple inheritance but java does not. 3) Java is platform independent language but c++ is depends upon operating system, machine etc. 4... Read More
How can you achieve Multiple Inheritance in Java?
Added on Tue, Dec 29, 2009
Java's interface mechanism can be used to implement multiple inheritance, with one important difference from c++ way of doing MI: the inherited interfaces must be abstract. This obviates the need to choose between different implementations, as... Read More
What is the class containing all the methods as static?
Added on Tue, Dec 29, 2009
Java.lang.Math class is a class in which all the methods are static.if some one know any other class please make an entry. Read More
How is rounding performed under integer division?
Added on Tue, Dec 29, 2009
The fractional part of the result is truncated. This is known as rounding toward zero. Read More
Explain the keywords - native, transient, volatile, finally
Added on Tue, Dec 29, 2009
Final variale cannnot be changed.. Final method cannot be overriddden.. Final class cannot be derived. Read More
What is the difference between the Font and FontMetrics classes?
Added on Tue, Dec 29, 2009
The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object. Read More
What is ServerSocket. How will you create a connection?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How does garbage collection work
Added on Tue, Dec 29, 2009
There are several basic strategies for garbage collection: reference counting, mark-sweep, mark-compact, and copying. In addition, some algorithms can do their job incrementally (the entire heap need not be collected at once, resulting in shorter... Read More
Can an object be garbage collected while it is still reachable?
Added on Tue, Dec 29, 2009
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected. Read More
What is Socket. How will you create a connection?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
The real time environment , when do we go for abstract class and when do we go for interfaces , can any one please revert back in this regard?
Added on Tue, Dec 29, 2009
Interface is the one which can be implemented by many number of methods in different classes as it requires, so there may be a chance that u may have some functionality which wil be need for many methods , in that case u u use interface to declare ... Read More
What's the difference between == and equals method?
Added on Tue, Dec 29, 2009
The equals method can be considered to perform a deep comparison of the value of an object, whereas the == operator performs a shallow comparison. The quals() method compares the characters inside a string object. == operator compares two object... Read More
How we can find the total number of processors available in system?
Added on Tue, Dec 29, 2009
Number of Processors can be known by using java.lang.Runtime.getRuntime().availableProcessors() Read More
How can you force all derived classes to implement a method present in the base class?
Added on Tue, Dec 29, 2009
Creating and implementing an interface would be the best way for this situation. Just create an interface with empty methods which forces a programmer to implement all the methods present under it. Another way of achieving this task is to declare a... Read More
When can an object reference be cast to an interface reference
Added on Tue, Dec 29, 2009
An object reference be cast to an interface reference when the object implements the referenced interface. Read More
What is the purpose of the System class?
Added on Tue, Dec 29, 2009
The purpose of the System class is to provide access to system resources. Read More
What is the use of unicast remote object
Added on Tue, Dec 29, 2009
When a class implements Remote interface it can not available in the client class.Thats why if we extends UnicastRemoteObject then we can rebind it through Naming.rebind("ref",objofserverclass) Read More
How to check for repeated patterns in a password?
Added on Tue, Dec 29, 2009
By using javascript In javascript we can break a string into small substring and compare each sub string . Read More
Describe java's security model.
Added on Tue, Dec 29, 2009
Java's security model is one of the most interesting and unique aspects of the language. For the most part it's broken into two pieces: the user adjustable security manager that checks various API operations like file access, and the byte... Read More
How would you declare a SingleThreaded servlet
Added on Tue, Dec 29, 2009
class serverlet_name extends HttpServlet implements SingleThreadModel { ......... ......... ......... } Read More
Can we serialize the static members?
Added on Tue, Dec 29, 2009
Yes, We can serialize the Static data also.For this we use the Externalizable tagged interface anduse writeObject() is used.Otherwise if we implement the Serializable interface if we serialize the data then static variable value is stored as zero.So... Read More
What are the similarities and differences between Java and C/C++?
Added on Tue, Dec 29, 2009
Features Java C/C++ Pointer No Yes Operator Overload No Yes Preprocessors No Yes Structures, Unions No Yes Enums No Yes Functions No (only methods within classes) Yes Goto statement No Yes Automatic Coercions No (types should be... Read More
Is it advisable to depend on finalize for all cleanups
Added on Tue, Dec 29, 2009
The purpose of finalization is to give an opportunity to an unreachable object to perform any clean up before the object is garbage collected , and it is advisable Read More
What is the difference between encapsulation & abstraction?
Added on Tue, Dec 29, 2009
Encapsulation is internal behavior, while Abstraction is External behavior Abstraction is mapping real world entity with s/w entity. By writing a class we can implement abstraction. While Encapsulation is encapsulating all properties with in... Read More
What are the differences between AWT and Swing
Added on Tue, Dec 29, 2009
AWT - Heavy weight component. Every graphical units it will invoke native methods. SWING - Light weight component. It doesn't invoke native methods. Read More
What is the difference between hiding & overriding ?
Added on Tue, Dec 29, 2009
overloading is related to one particular class.If we define two methods in the same class with same name,but different input parameters. Then it is called overloading.Overridig is related to super and sub class.He you define a method with same name ,... Read More
Which characters may be used as the second character of an identifier, but notas the firstcharacter of an identifier
Added on Tue, Dec 29, 2009
The digits 0 through 9 may not be used as the first character of an identifier but they maybe used after thefirst character of an identifier. Read More
What is phantom memory
Added on Tue, Dec 29, 2009
Phantom memory is false memory.Memory that does not exist in reality. Read More
What do you like most with Ant
Added on Tue, Dec 29, 2009
ANT - means Another Neat Tools. ANT is mainly used for build serverside applictions. Read More
What is the difference between the String and StringBuffer classes
Added on Tue, Dec 29, 2009
String objects are constants. StringBuffer objects are not. Read More
Can an anonymous class be declared as implementing an interface andextending a class
Added on Tue, Dec 29, 2009
An anonymous class may implement an interface or extend a superclass, but may not bedeclared to doboth. Read More
How all can you instantiate final members
Added on Tue, Dec 29, 2009
Final member can be instantiate only at the time of declaration.null Read More
In which package are most of the AWT events that support the event-delegationmodel defined
Added on Tue, Dec 29, 2009
Most of the AWT-related events of the event-delegation model are defined in thejava.awt.event package.The AWTEvent class is defined in the java.awt package. Read More
Can a method be static and synchronized
Added on Tue, Dec 29, 2009
A static method can be synchronized. If you do so, the JVM will obtain a lock on the java.lang.Class instance associated with the object. It is similar to saying: synchronized(XYZ.class) { } Read More
What is innerclass?
Added on Tue, Dec 29, 2009
Its a kind of nested class which is NON-STATIC i.e. it has access to all var and methods of its outer class or it is fully within the scope of its enclosing class BUT the outer class to this inner class needs to create object of inner class to access... Read More
I can get the size(length) of any array (let a[]) by a.length. please tell me what is this "length" word actually signifies, where it is defined in java and what is its actual definition ?
Added on Tue, Dec 29, 2009
length is not a method ,It is a varaible which identifies the length of the array by subtracting one with the index position of (null)'/0'. postion of the index at present - 1 ---------> gives the len of the variable ( so... Read More
What is the advantage of the event-delegation model over the earlier eventinheritancemodel
Added on Tue, Dec 29, 2009
The event-delegation model has two advantages over the event-inheritance model. First,it enables eventhandling to be handled by objects other than the ones that generate the events (or theircontainers). Thisallows a clean separation between a... Read More
If a class is declared without any access modifiers, where may the class beaccessed
Added on Tue, Dec 29, 2009
A class that is declared without any access modifiers is said to have package access. Thismeans that theclass can only be accessed by other classes and interfaces that are defined within thesame package. Read More
What is the relationship between the Canvas class and the Graphics class?
Added on Tue, Dec 29, 2009
A Canvas object provides access to a Graphics object via its paint() method. Read More
What is the relationship between a method's throws clause and the exceptionsthat can bethrown during
Added on Tue, Dec 29, 2009
A method's throws clause must declare any checked exceptions that are not caught withinthe body of themethod. Read More
can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?
Added on Tue, Dec 29, 2009
Yaa u can declare multiple main methods in different classes, this wont through any error while complition , but it through u runtime exception stating that no main method found.So there should be only one main method in a program Read More
Does Java has pointer?
Added on Tue, Dec 29, 2009
No java does not have a pointer but we can use the new operator for ex: the name of the method is firstname we can create a objectas firstname f=new firstname this allocates the memory according to the size of the method firstname ... Read More
What is the difference between the JDK 1.02 event model and the eventdelegationmodelintroduced with JDK 1.1
Added on Tue, Dec 29, 2009
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model,components arerequired to handle their own events. If they do not handle a particular event, the event isinherited by (orbubbled up to) the component's... Read More
What is an abstract method?
Added on Tue, Dec 29, 2009
An abstract method is a method whose implementation is deferred to a subclass. Read More
How to call a COM object within java?
Added on Tue, Dec 29, 2009
com4j A Java library that allows Java applications to seemlessly interoperate with Microsoft Component Object Model. First generate Java type definitions from a COM type library. Here we are doing for the type library for the Windows Scripting... Read More
How is it possible for two String objects with identical values not to be equalunder the ==operator
Added on Tue, Dec 29, 2009
The == operator compares two objects to determine if they are the same object inmemory. It is possible fortwo String objects to have the same value, but located indifferent areas of memory. Read More
Will there be a performance penalty if you make a method synchronized? If so, can you make any design changes to improve the performance
Added on Tue, Dec 29, 2009
Performance does take a hit when using synchronization. I think the way to reduce this hit is to synchronize only a block of code that will be accessed by threads and not synchronize the entire method. Read More
Replacing Characters in a String?
Added on Tue, Dec 29, 2009
// Replace all occurrences of 'a' with 'o' String newString = string.replace('a', 'o'); Replacing Substrings in a String static String replace(String str, String pattern, String replace) { int s = 0; int... Read More
Why we need to serialize the object
Added on Tue, Dec 29, 2009
Serialization means to convert into byte stream ,we need to serialize object so that if many thread calls that function then consistentency should be maintained. Read More
When should i used notify() and notifyall() methods on threads?
Added on Tue, Dec 29, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the advantage of the event-delegation model over the earlier event inheritance model?
Added on Tue, Dec 29, 2009
The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a... Read More
Why do we need interface in Java. Instead of interface we can write the methods in the class itself. Why do we need seperate interface
Added on Tue, Dec 29, 2009
Java don't support Multiple Inheritance. For that we can use Interface. Interface is like the getway to comunicate between to classes. Not always we write methods in Interface, we can also create objects in the Interface. The Object which... Read More
What is EJB
Added on Tue, Dec 29, 2009
EJB is a Server side resident resource managable, trasactional, persistable, secure, reusable component. Read More
How to make jdbc connection a protable without specific drivers
Added on Tue, Dec 29, 2009
JDBC can't do its job without a driver, and the JDBC management layer must know the location of each and every database driver available to it. There are two ways that JDBC does this. First, upon initialization, the java.sql.DriverManager... Read More
What are the disadvantages of reference counting in garbage collection
Added on Tue, Dec 29, 2009
An advantage of this scheme is that it can run in small chunks of time closely interwoven with the execution of the program. This characteristic makes it particularly suitable for real-time environments where the program can't be interrupted for... Read More
What must a class do to implement an interface?
Added on Tue, Dec 29, 2009
It must provide all of the methods in the interface and identify the interface in its implements clause. Read More
What does a static inner class mean? How is it different from any other static member
Added on Tue, Dec 29, 2009
A static inner class behaves like any ``outer'' class. It may contain methods and fields. It is not necessarily the case that an instance of the outer class exists even when we have created an instance of the inner class. Similarly,... Read More
How to make a class or a bean serializable?
Added on Tue, Dec 29, 2009
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. Read More
What are the two basic ways in which classes that can be run as threads may be defined?
Added on Tue, Dec 29, 2009
A thread class may be declared as a subclass of Thread, or it may implement the Runnable interface. Read More
Does java do reference counting
Added on Tue, Dec 29, 2009
It is more likely that the JVMs you encounter in the real world will use a tracing algorithm in their garbage-collected heaps Read More
What is the Locale class?
Added on Tue, Dec 29, 2009
The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region. Read More
When you use a struts framework, where would you place your business logic
Added on Tue, Dec 29, 2009
We know how servlets and JSP's applications will be . They are all Model1 arcitectures. where we cant get the MVC (M2c) model architecture .So, we use this structs framework. And in this we can write the Business logic in Action class which is... Read More
Which Java operator is right associative?
Added on Tue, Dec 29, 2009
The = operator is right associative. Read More
For what purpose java language is named as java?
Added on Tue, Dec 29, 2009
In reference of McCarthy : Java came from several individuals involved in the project: James gosling, Arthur, Van hoff, Andy bechtolsheim. Read More
What is a memory footprint? How can you specify the lower and upper limits of the RAM used by the JVM? What happens when the JVM needs more memory
Added on Tue, Dec 29, 2009
Memory footprint : is the amount of memory a particular application is using.The JVM keeps a check on this by its sandbox mechanism. The sandbax always has the correct knowledge of the amount of space a particular program is using. Many time in real... Read More
What is the argument type of a program's main() method?
Added on Tue, Dec 29, 2009
A program's main() method takes an argument of the String[] type. Read More
What method must be implemented by all threads?
Added on Tue, Dec 29, 2009
All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface. Read More
Class hierarchy of AbstractMap is as follows
Added on Tue, Dec 29, 2009
Question : Class hierarchy of AbstractMap is as follows "AbstractMap implements Map" Class hierarchy of HashMap is as follows "HashMap extends AbstractMap implements Map" When AbstractMap implements Map interface and AbstractMap is extended... Read More
When you have an object passed to a method and when the object is reassigned to a different one, then is the original reference lost
Added on Tue, Dec 29, 2009
In Java, it is ALWAYS pass by VALUE. Confusion occurs because all OBJECT variables in Java are references to objects. When we call a method in Java, the object reference is PASSED BY VALUE to the method (this means that a variable for the method&... Read More
What is the purpose of the finally clause of a try-catch-finally statement?
Added on Tue, Dec 29, 2009
The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught. Read More
What is callback function?
Added on Tue, Dec 29, 2009
The function is implement by you but call by container it self. like the life cycle of any class like servlet init() service() destroy() and in ejb we have ejbCreate() like........... Read More
Do primitive types have a class representation
Added on Tue, Dec 29, 2009
Primitive data type has a wrapper class to present. Like for int - Integer for byte Byte, for long Long etc ... Read More
wat is the disadvantage of threads
Added on Tue, Dec 29, 2009
main disadvantage of thread is that we need to synchronize the object while using the thread Read More
What is the difference between string and string buffer
Added on Tue, Dec 29, 2009
String is immutable & unchagable.In this situation String buffer provide the fact.we can modify our required string by it. Read More
How do you declare constant values in java?
Added on Tue, Dec 29, 2009
variable can be made constant only with the help of a final keyword. If you want to make it to be accessible from other classes then you need static. Read More
Can we declare final variables in side a method.
Added on Tue, Dec 29, 2009
It is useful in cases like if u dont want to reassign second value . ex :Gravitational Force. Read More
can dead thread restart?
Added on Tue, Dec 29, 2009
A dead Thread can't restart not even by calling start() again on that object. Read More
How would you implement a thread pool
Added on Tue, Dec 29, 2009
Public class ThreadPool extends java.lang.Object implements ThreadPoolInt This class is an generic implementation of a thread pool, which takes the following input a) Size of the pool to be constructed b) Name of the class which implements... Read More
What is the GregorianCalendar class?
Added on Tue, Dec 29, 2009
The GregorianCalendar provides support for traditional Western calendars. Read More
What modifiers may be used with a top-level class?
Added on Tue, Dec 29, 2009
A top-level class may be public, abstract, or final. Read More
Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this the OS heap or the heap maintained by the JVM? Why
Added on Tue, Dec 29, 2009
yes the JVM maitain a cache by itself.No it allocates the objects in stack ,in heap on references .Heap maintained by the JVM because every time the JVM should not use objects directly it uses only references that's why the heap maintained by... Read More
Name three subclasses of the Component class?
Added on Tue, Dec 29, 2009
Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent Read More
What is a Java package and how is it used?
Added on Tue, Dec 29, 2009
A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to... Read More
What is the corresponding Layout for Card in Swing
Added on Tue, Dec 29, 2009
You can use same card layout in swings also. therse is no other layout in swings. Read More
What is the difference between the Boolean & operator and the && operator?
Added on Tue, Dec 29, 2009
If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the firstoperand is evaluated. If... Read More
What is the purpose of a statement block?
Added on Tue, Dec 29, 2009
A statement block is used to organize a sequence of statements as a single statement group. Read More
What is components and controllers in Java
Added on Tue, Dec 29, 2009
Components are the like Frame, button all these are the Component of awt package. while controllers are the events whenever we click on any button it is the controller which controls what has to do. Read More
What invokes a thread's run() method?
Added on Tue, Dec 29, 2009
After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread'srun() method when the thread is initially executed. Read More
What is the difference between the prefix and postfix forms of the ++ operator?
Added on Tue, Dec 29, 2009
The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value. Read More
What is a "Java Client" ?
Added on Tue, Dec 29, 2009
Java client is a user those who r developing applications or working with the java. and Java server is a JVM/JRE which r running our applications or set of instructions with the bussiness logic. Read More
Mention 5 basic difference between Array List and Vector in Java Colletion FrameWork.
Added on Tue, Dec 29, 2009
Vector is a legacy class but ArrayList is not Vector is thread safe but ArrayList is not ArrayList give better performance as Vector has to suffer this due to synchronisation Read More
What is the difference between a public and a non-public class?
Added on Tue, Dec 29, 2009
A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package. Read More
In what situations we can use innerclass and anonymous class
Added on Wed, Dec 30, 2009
To help you get a handle on inner classes and what they are good for, let's visit the "Stack" class.Here's a "Stack" implementation that defines a helper class, called StackIterator , for enumerating the stack's elements: public... Read More
In which package are most of the AWT events that support the event-delegation model defined?
Added on Wed, Dec 30, 2009
Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package.The AWTEvent class is defined in the java.awt package. Read More
What does validate() pack() mean in Frames
Added on Wed, Dec 30, 2009
if you change any sub component in a top label container then ,suppose you change some button layout in a frame then that will automatically call by paint to update to validate. that means three method will call one after another . The pack method... Read More
What is the range of the char type?
Added on Wed, Dec 30, 2009
The range of the char type is 0 to 2^16 - 1. Read More
What is numeric promotion?
Added on Wed, Dec 30, 2009
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type,so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values... Read More
What is the range of the short type?
Added on Wed, Dec 30, 2009
The range of the short type is -(2^15) to 2^15 - 1. Read More
Why Concept Of Pointer is not there in java
Added on Wed, Dec 30, 2009
Pointers are not there mainly to avoid security threats. As JVM restricts access to the file system, but thru pointers you can access any memory location. This is the main reason, other is to avoid the complexity. Read More
What do you mean by multiple inheritance in C++ ?
Added on Wed, Dec 30, 2009
Multiple inheritance is a feature in C++ by which one class can be of different types. Say class teachingAssistant is inherited from two classes say teacher and Student. Read More
What is socket? and server socket
Added on Wed, Dec 30, 2009
Socket=port + ip in layman language socket is just like for where ip is the adress of that fort and port is the gate to enter in to that fort. server socket is the socket which present on server side basically used to listen request from... Read More
It is essential to catch all types of exceptions
Added on Wed, Dec 30, 2009
It is essential to catch/declare throws clause for checked exceptions. Unchecked exceptions need not be handled. Read More
When a thread is created and started, what is its initial state?
Added on Wed, Dec 30, 2009
A thread is in the ready state after it has been created and started. Read More
How you can add the 10 days in the current date in jsp?
Added on Wed, Dec 30, 2009
Date date = new Date(); Calendar cal = new GregorianCalendar(); date=cal.setTime(Calendar.DAYS+10) date=cal.getTime(date); Read More
What class is the top of the AWT event hierarchy?
Added on Wed, Dec 30, 2009
The java.awt.AWTEvent class is the highest-level class in the AWT event-classhierarchy. Read More
What are three ways in which a thread can enter the waiting state?
Added on Wed, Dec 30, 2009
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its... Read More
What are some alternatives to inheritance?
Added on Wed, Dec 30, 2009
Delegation is an alternative to inheritance. Delegation means that you include an instance of another class as an instance variable, and forward messages to the instance. It is often safer than inheritance because it forces you to think about each... Read More
What is a task's priority and how is it used in scheduling?
Added on Wed, Dec 30, 2009
A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks. Read More
Which arithmetic operations can result in the throwing of an ArithmeticException?
Added on Wed, Dec 30, 2009
Integer / and % can result in the throwing of an ArithmeticException. Read More
Why main method should be declared as public and why in some versions it is mandatory and in some versions it is not mandatory??
Added on Wed, Dec 30, 2009
Public static void main(String args[]) Here we helping the jvm to call main method without any object that is why main is declared as public static. Read More
What is the difference between Inheritance and Aggrigation?
Added on Wed, Dec 30, 2009
Inheritance is a class extending another class. Abstraction is an inteface implementing another interface, so that a class implementing the interface A whch implements interface B should provide the implementation for all the methods in interface A... Read More
What is the difference between a MenuItem and a CheckboxMenuItem
Added on Wed, Dec 30, 2009
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked orunchecked. Read More
What is a layout manager?
Added on Wed, Dec 30, 2009
A layout manager is an object that is used to organize components in a container. Read More
What is the order of intialization of variables in Java.
Added on Wed, Dec 30, 2009
When an object is created, all its fields are set to default initial values for their respective types(zero for all numeric types, false for boolean, u000 for char, and null for object reference.) Then the constructor is invoked. Each constructor... Read More
What happens if an exception is not caught?
Added on Wed, Dec 30, 2009
An uncaught exception results in the uncaughtException() method of the thread's ThreadGroup being invoked, which eventually results in the termination of the programin which it is thrown. Read More
Why we can't put semicolon at the end of a class in java??
Added on Wed, Dec 30, 2009
We can give semicolon at the end of the class. but it is not necessary, generally we will not use because java uses } as the end of the class, semicolon for end of the statements Read More
How can a Variable in a class other than String type be made Immutable.
Added on Wed, Dec 30, 2009
Provide a constructor to initilize the variable and remove the mutator method ( setter method) for that variable. Read More
How we can implement the constructer nesting in java
Added on Wed, Dec 30, 2009
Constructor nesting can be achieved by using : this(parameters....) constructors with parameters can use the above to delagate calls to a non argument constructor and vice versa. Read More
When a thread blocks on I/O, what state does it enter?
Added on Wed, Dec 30, 2009
A thread enters the waiting state when it blocks on I/O. Read More
i want to know the difference between these two programs mean the flow
Added on Wed, Dec 30, 2009
Question : i want to know the difference between these two programs mean the flow /*public class Aquestion { private int i = giveMeJ(); private int j = 10; private int giveMeJ() { return j; } public static void main(String... Read More
What are order of precedence and associativity, and how are they used?
Added on Wed, Dec 30, 2009
Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left. Read More
What interface is extended by AWT event listeners?
Added on Wed, Dec 30, 2009
All AWT event listeners extend the java.util.EventListener interface. Read More
How do you release an object which is locked in a synchronized block
Added on Wed, Dec 30, 2009
By using notify() or notifyAll() method we can release the lock.But notify() method sometimes notify unwanted thread.So in some situation notify() method is avoidable. Read More
Can You catch the Error?
Added on Wed, Dec 30, 2009
Question : Can You catch the Error? 2. Difference between compiletime exception and runtime exception? 3. How you throw user defined exception? 4. How you handle throwable while using exceptions ? 5. What are the methods... Read More
What is a compilation unit?
Added on Wed, Dec 30, 2009
A compilation unit is a Java source code file. Read More
Difference between Enumeration and Iterator
Added on Wed, Dec 30, 2009
The Enumeration interface is what allows you to walk through the elements of a legacy collection(ie., for Synchronized Collections). Iterator interface is used for stepping through the elements(.ie., for ArrayList,LinkedList). Read More
Scope Variables
Added on Wed, Dec 30, 2009
A variable's scope is the region of a program within which the variable can be referred to by its simple name. The location of the variable declaration within your program establishes its scope and places it into one of these four categories... Read More
What is a native method?
Added on Wed, Dec 30, 2009
native method is a method that is implemented in a language other than Java. Read More
What is clipping?
Added on Wed, Dec 30, 2009
Clipping is the process of confining paint operations to a limited area or shape. Read More
I want to know output of this program and the flow also
Added on Wed, Dec 30, 2009
Question : I want to know output of this program and the flow also public class Aquestion { private int i = giveMeJ(); private int j = 10; private int giveMeJ() { return j; } public static void main(String args[]) { ... Read More
How does >> operater works ?
Added on Wed, Dec 30, 2009
It is right shift operator, which will produce divide by 2 action. For example 10>>2 will produce 5. the binary value of 10 is "1010" if we right shift the above by one position it will be "0101" this is equivalent to 5. Read More
what is assert function
Added on Wed, Dec 30, 2009
Question : what is assert function what are the type how they are used with an example Answers: An assertion is a statement in the that enables you to test your assumptions about your program. Syntax: assert Expression1 :... Read More
Write a java standalone program / method to take out all the special
Added on Wed, Dec 30, 2009
Question : Write a java standalone program / method to take out all the special characters in the string provided below. // ASCII a ? z (97 ? 122) String sSENTENCE = ?This!is^a$t*e)s|t?; Answers: class... Read More
In a large-scale multi-threaded environment, how might you organise access to a shared resource (such as a database connection)?
Added on Wed, Dec 30, 2009
We can have connection pool used for such cases like for DB connections. For each thread accessing the DB, one connection object will be taken from the connection pool and will be given to the thread.Once the job is done the object goes back to... Read More
What's the difference between the == operator and the equals() method? What test does Object.equals() use, and why?
Added on Wed, Dec 30, 2009
The == operator would be used, in an object sense, to see if the two objects were actually the same object. This operator looks at the actually memory address to see if it actually the same object. The equals() method is used to compare the values... Read More
Can we set the time (by user) explicitly for garbage collection.?
Added on Wed, Dec 30, 2009
Even calling the garbage collector method doesn't ensure that garbage collection will take place. Its just a request method. Read More
The following code is executed by a multi-threaded environment:
Added on Wed, Dec 30, 2009
Question : The following code is executed by a multi-threaded environment: public void functionOne() { System.out.println("Staring itrs= " + this.cntr); for( int i=0; i<this.cntr; i++ ) { System.out.println("iteration: " + i); } ... Read More
Discuss the differences between creating a new class, extending a class and implementing an interface; and when each would be appropriate.
Added on Wed, Dec 30, 2009
Creating a new class is simply creating a class with no extensions and no implementations. The signature is as follows public class MyClass() { } *Extending a class is when you want to use the functionality of another class or classes. The extended... Read More
Which package is always imported by default?
Added on Wed, Dec 30, 2009
The java.lang package is always imported by default. Read More
What is the disadvantage of paint method in Applet
Added on Wed, Dec 30, 2009
The paint() method is called each time a Applet must be redrawn. Read More
Why java.lang Package is the Default package?
Added on Wed, Dec 30, 2009
In java.lang package Object class is there which is the super super class of all class in java language so in order to import that jdk soft implicitly provides Default package Read More
How to track "memory leak" and how to prevent it in java?
Added on Wed, Dec 30, 2009
To reduce possibility of memory leaks, following things should be kept in mind. Try to avoid long recursive loops in the code. This leads to an OutOfMemoryError. Avoid collections as static members of a class. If so, carefully manage... Read More
Name three Component subclasses that support painting?
Added on Wed, Dec 30, 2009
The Canvas, Frame, Panel, and Applet classes support painting. Read More
What happen if we write many curly braces in main method and write println method inside it .program will compile or not?
Added on Wed, Dec 30, 2009
You can have any number of curly braces inside any(main as well as other) functions but each and every brace should have matching close brace. Also you can have any number of semi colons(;) The following program compiles and print the message ... Read More
What is the difference between the File and RandomAccessFile classes?
Added on Wed, Dec 30, 2009
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file. Read More
What is the diffrence between JRE and JVM?
Added on Wed, Dec 30, 2009
The JVM is core for JAVA programing , When you are trying to run applet or Frame based Application(developed by applet or swing ) there JRE Should be there. With out JRE ,you can run the simple java code which dont have any applet or swing... Read More
What is the difference between servlets and jsp
Added on Wed, Dec 30, 2009
Servlet: we used to call HTML in java program JSP: we call java in HTML this is the simple logic, i dint in touchup with the presentation and application sketches. Read More
How can we store elements in arraylist? as by using index or by node?
Added on Wed, Dec 30, 2009
We can store elements in arraylist by using index Read More
What restrictions are placed on the location of a package statement within asource code file?
Added on Wed, Dec 30, 2009
package statement must appear as the first line in a source code file (excluding blank lines and comments). Read More
Can we have 3 methods in a single servlet i.e service(), doPost() and doGet() method. If yes, then what method will be called. Tell me the servlet cycle in such cases
Added on Wed, Dec 30, 2009
First servlet looks for the service() method.If in the case service() method is not present in that appilication, then looks for the doPost() method.If doPost() method is also not present in your appilication ,then servlet looks for the doGet()... Read More
In overriding, the super class method throws I/O exception & in sub class that method throws arithmetic exception. what happens?
Added on Wed, Dec 30, 2009
While overriding, methos in subclass can not throw any new checked exception. it can only decalre exception already declared in the super class or its subclasses. since Airthmetic exception is an unchecked exception it can be declared without any... Read More
Is it true the JAVA is realy a plateform indepandent?
Added on Wed, Dec 30, 2009
Java is a platform independent but it has some drawback it is not thread independent and garbage collection independent because of that drawback we are not able to controll some real life applications like to controll plane, to controll nuclear power... Read More
In overriding, in super class we declared a method as protected & in sub class we declared that method as private. what happens?
Added on Wed, Dec 30, 2009
In ovveriding in subclass the access specifier should be less restrictive. if protected is used in super class then in sub class u can use public and protected both but not private. if u try to use private it will not be compiled. Read More
whats the difference in data types of java and c++?
Added on Wed, Dec 30, 2009
Question : whats the difference in data types of java and c++? 2)what is the use of finally block?? 3)what is encapsulation in oops?how is it achieved in Java? Answers: The types supported by Java are the primitive data... Read More
Does Java have "goto"?
Added on Wed, Dec 30, 2009
What does the "final" keyword mean in front of a variable? A method? A class?
Added on Wed, Dec 30, 2009
FINAL for a variable : value is constant. FINAL for a method : cannot be overridden. FINAL for a class : cannot be derived. Read More
Can a lock be acquired on a class
Added on Wed, Dec 30, 2009
In class level the most exclusive lock can be achieved by synchronising the class's class object and declaring it static. Read More
What exactly is volatile & please tell the at what situation we use this key-word and please give an example as well
Added on Wed, Dec 30, 2009
The volatile keyword is used on variables that may be modified simultaneously by other threads. This warns the compiler to fetch them fresh each time, rather than caching them in registers. This also inhibits certain optimisations that assume no... Read More
What is the difference between equals and ==
Added on Wed, Dec 30, 2009
The == comparator simply checks to see that two primitives are equivelent by virtue of memory location. The equals( ) method will actually check to see that the values of the two objects are equivelent. A good rule of thumb is to always use the... Read More
What is the difference between runtime polimorphism, and compiletime polimorphism ?
Added on Wed, Dec 30, 2009
Run time polimorphism means function call is resolved at run time.It means which function code will execute in response to a perticular function call is not known till execution of program.ex- Funtion overriding. Compile time polimorphism means... Read More
What is the difference between the >> and >>> operators
Added on Wed, Dec 30, 2009
The >> operator causes the bits of the left operand to be shifted to the right, based on the value of the right operand. The bits that fill in the shifted left bits have the value of the leftmost bit (before the shift operation). The >>... Read More
What method is invoked to cause an object to begin executing as a separate thread?
Added on Wed, Dec 30, 2009
The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread. Read More
What is the difference between a break statement and a continue statement
Added on Wed, Dec 30, 2009
Break statement A statement that terminates the current loop iteration and causes execution to break out of a loop. Continue statement A statement that terminates the current loop iteration and persists the loop with the next iteration. Read More
What is differnce between byte code and unicode?
Added on Wed, Dec 30, 2009
Byte code is simply the converted source code into arrays of bytes and generated after compilation of source code and is understandable only for interpreter or you can say java run time environment. Unicode is character standard to represent... Read More
What is the webserver used for running the Servlets
Added on Wed, Dec 30, 2009
Following Severs are avilable 1 Tomcat Apatche 2 IIS 3J2ee 4 Jboss 5BEA WebLogic Server 6iPlanet 7 Oracle 8Orion Server 9 WebSphere 10NetDynamics 11JRun Server 12Tomcat 13JOnAS 14Pramati Server 15Power Tier for J2EE Read More
What is an Iterator interface?
Added on Wed, Dec 30, 2009
The Iterator interface is used to step through the elements of a Collection. Read More
What modifiers may be used with an inner class that is a member of an outerclass?
Added on Wed, Dec 30, 2009
A (non-local) inner class may be declared as public, protected, private, static, final, orabstract. Read More
How to check infinity value? when we passed too large number in String and cast in to float value it will be give infinity. how to catch it?
Added on Wed, Dec 30, 2009
s, we can get the output by throws exception method. that is by extending throws exception from the class method defined. Read More
Which method of the Component class is used to set the position andsize of a component
Added on Wed, Dec 30, 2009
SetBounds(int x, int y, ing width, int height): It is a method of a component to location and size a component. But it will work only when the container doesn't have any one of default managers. If a component already has any one of... Read More
How to access Blob and Clob data values from oracle thru java?
Added on Wed, Dec 30, 2009
U can do this by using the methods getBlob(int i),getBlob(String col),getClob(int i),getClob(Strin col) of the ResultSet Read More
How does Java handle integer overflows and underflows?
Added on Wed, Dec 30, 2009
It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. Read More
How is it possible for two String objects with identical values not to be equalunder the == operator? s
Added on Wed, Dec 30, 2009
The == operator compares two objects to determine if they are the same object inmemory. It is possible for two String objects to have the same value, but located in different areas of memory. Read More
What is final variable
Added on Wed, Dec 30, 2009
A final variable is the one whose value cannot be changed. It is a constant. Read More
What is the List interface
Added on Wed, Dec 30, 2009
The List interface provides support for ordered collections of objects. Read More
What is the difference between the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1?
Added on Wed, Dec 30, 2009
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (or bubbled up to) the component's... Read More
A Inner class is defined in a parameterized function of outer class then the inner class is able to access the parameters of that function?
Added on Wed, Dec 30, 2009
The inner class cannot access the parameters of the function in which it defined, unless the keyword "final" is not used with them. Read More
Which characters may be used as the second character of an identifier, but notas the first character of an identifier?
Added on Wed, Dec 30, 2009
The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier. Read More
What is the relationship between a method's throws clause and the exceptions that can be thrown during the method's execution?
Added on Wed, Dec 30, 2009
A method's throws clause must declare any checked exceptions that are not caught within the body of the method. Read More
Why is collection framework called as framework?
Added on Wed, Dec 30, 2009
A framework is collection of interfaces and classes. java.util.Collection package having enough interfaces and classes to make them as a framework. in short framework is developed standard library Read More
What is meant by memory leak?
Added on Wed, Dec 30, 2009
Memory leak is when memory used by an object or variable cannot be freed even after the code that created the object/ variable has finished execution. According to wikipedia: Memory leaks are often thought of as failures to release unused memory by... Read More
What is a transient variable
Added on Wed, Dec 30, 2009
Declaring a Transient Variable You use the transient keyword to indicate to the Java virtual machine that the indicated variable is not part of the persistent state of the object. Variables that are part of the persistent state of an object... Read More
What is the difference between trusted and untrusted applet?
Added on Wed, Dec 30, 2009
In general, applets loaded over the net are prevented from accessing files on the client machine, and from making network connections except to the host originating the applet.In addition, applets loaded over the network are prevented from starting... Read More
Which containers use a FlowLayout as their default layout?
Added on Wed, Dec 30, 2009
The Panel and Applet classes use the FlowLayout as their default layout. Read More
How to position TextField in a frame so that it Should look Good.And in a manner that next one will come in next row of the first appeared.
Added on Wed, Dec 30, 2009
u can try with gridlayout(no of columns,no.of rows) set GridLayout(5,2) When u set ur components here, ull get on the order, of 5 x 2. if u want to put entire things in to order, FlowLayout() is usefull Read More
What is the preferred size of a component?
Added on Wed, Dec 30, 2009
The preferred size of a component is the minimum component size that will allow the component to display normally. Read More
Name four Container classes.Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
IS String is a wrapperclass? explain wrapper class
Added on Wed, Dec 30, 2009
Wrapper class is class that allows us to access primitive data types as objects. Read More
How do you push an applet in to the servlet?
Added on Wed, Dec 30, 2009
To make the applet talk to the servlet you need to use HttpURLConnection. Open a URLConnection from an apple to the sevlet by using the url path of the servlet in the applet. Then use InputStreams to the servlet and write you data to the... Read More
Is it necessary that there should be only one controller in MVC architechture? and why?
Added on Wed, Dec 30, 2009
MVC Model View Controller This is basically an architecture that is used to stress the reusing object oriented concept that will be conducive for programmer as well others. You can use more than one controller.As when you undergo different kind... Read More
Why is the Object class super class of all the classes?
Added on Wed, Dec 30, 2009
In object class it contain some methods like hashCode(), toString() methods. this two methods is used to give some information. for example in my project devlepoment i use several classes at some point time i get confused what sort of information i... Read More
Why multiple inheritace is not supported through classes in java ?
Added on Wed, Dec 30, 2009
java does not support Multiple inheritance because 1. If the two super classes(multiple interitance contain more than one super class) has same method, there is confusion in accessing the method 2. in other hand, in the same scenrio, the first... Read More
Can we serialize the static variable?
Added on Wed, Dec 30, 2009
Yes we can serialize the static variable.if u don't want to serialize, u need to declare the variable as transient Read More
In which package are most of the AWT events that support the event-delegation model defined
Added on Wed, Dec 30, 2009
Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWT Event class is defined in the java.awt package. Read More
What is the difference between Delegation event model and Inheritance event model
Added on Wed, Dec 30, 2009
Event delegation model allows other objects to handle the events rather than the objects on which they were produced, Also uneccessary events are not handled. Read More
How are Observer and Observable used?
Added on Wed, Dec 30, 2009
Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is... Read More
What is the range of the short type
Added on Wed, Dec 30, 2009
2 bytes, signed (two's complement), -32,768 to 32,767 Read More
What is the main difference between input, output stream
Added on Wed, Dec 30, 2009
Streams are the rooted ,specific connections between the source and aplication.input stream are the connection between source to application and vise varsa.the input stream and outputstream aer the sub class of byte stream.they only transfer the... Read More
Which non-Unicode letter characters may be used as the first characterof an identifier?
Added on Wed, Dec 30, 2009
The non-Unicode letter characters $ and _ may appear as the first character of an identifier. Read More
Why do threads block on I/O
Added on Wed, Dec 30, 2009
Threads block on i/o (that is enters the waiting state) so that other threads may executewhile the i/o Operation is performed. Read More
let say there are two interfaces like the following
Added on Wed, Dec 30, 2009
Question : let say there are two interfaces like the following interface int1{ int meth1(); } interface int22{ int meth1(); } ok then i am implementing both of them in a calss as follows class mycl implements... Read More
What is the difference between Vector, Array and Arraylist
Added on Wed, Dec 30, 2009
1.Vector and Arraylist are grownable or shinkable where are array is not. 2.Vector and Arraylist are implemented from List interface where as array is a primitive data type 3.Vector is Synchrnized where as arraylist is not 4.For best... Read More
In client-server approach, how to get an IP address of remote machine, and how we can find whether tht machine is connected
Added on Wed, Dec 30, 2009
Question : In client-server approach, how to get an IP address of remote machine, and how we can find whether tht machine is connected with server or not. I hv found one solution is pinging in background, but how we can do such pinging? how... Read More
What is the difference between a MenuItem and a CheckboxMenu Item?
Added on Wed, Dec 30, 2009
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked. Read More
What is synchronization and why is it important
Added on Wed, Dec 30, 2009
Synchronization is a process of letting one thread to access the method while all other thread are waiting, which avoids deadlock Read More
What is the functionality stubs and skeletons
Added on Wed, Dec 30, 2009
Stub: Stub is a client side proxy,the duty of stub is to convert the java code into bit-blobs streams(Network oriented stream).This is also known as "Marshalling". Skeleton: Skeleton is a server side proxy,the duty of skeleton is to convert the bit... Read More
Why java shouldbe preferred,when we can get the sameoutput using VB orany otherlanguages. Howcan we convincethe interviewer ,other than givingthe simple features ofjava. could anyone pls answer this question?
Added on Wed, Dec 30, 2009
It is platform independence. The client can get assurance that his application can work on any OS. It is hardware independence. It is Secured, Robust and portable. The main advantage of java is it is open source i.e the user no need to... Read More
Why is it often difficult to separate the business layer from the data access layer
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What's new with the stop(), suspend() and resume() methods in JDK 1.2
Added on Wed, Dec 30, 2009
Please Stop using JAVA 1.2 Coz there are many methods which are deprecated in Java 1.4. For thread stop, suspend are deprecated in JAva 1.4 Read More
How can we inherit the two independent classes in one class? for example, we have two independent classes like Class A and B. I want to inherit the methods of Class A and B.
Added on Wed, Dec 30, 2009
class A { public void show(){System.out.println("A");} } class B { public void show1(){System.out.println("B");} } class c { A a=null; B b=null; c() { a=new A(); b=new B(); } public void show2() { a.show(); b.show1(); } } ... Read More
What are the advantages of developing an n-tiered system?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the datatypes in java
Added on Wed, Dec 30, 2009
A variable's data type determines the values the variable can contain and the operations that can be performed on it. The Java programming language has two categories of data types ? a)Primitive b)Reference(A data element whose... Read More
How will you perform transaction using JDBC
Added on Wed, Dec 30, 2009
Using the autocommit method provided by the connection object. Read More
What is the main difficulties that you are faced in your project?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between java and c and c++?s
Added on Wed, Dec 30, 2009
Java does not support Pointers, C++ support pointers. Java does not support structures and unions as C++. In C, code is organized into functions, which are global subroutines accessible to a program. C++ added classes and in doing so provided... Read More
How have you done validation of the fileds in your project?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the range of the char type
Added on Wed, Dec 30, 2009
Char is unsigned so its minimum value is 0. It can't be negative. Read More
What is the role of the webserver?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What state does a thread enter when it terminates its processing
Added on Wed, Dec 30, 2009
After thread stops processing and has completed its run method it enters a dead state. Dead here signifies that it may no more "excute". Though it still remains to be a notmal java object in memeory n u can call other non-thread specific methods on... Read More
What is root class of all java classes
Added on Wed, Dec 30, 2009
Object is the root class of all java classes.It is the mother of all classes Read More
What is the difference between static and non-static variables
Added on Wed, Dec 30, 2009
A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance. Read More
What is the difference between Classpath and Import
Added on Wed, Dec 30, 2009
Import is used to import .ie bring ur java packages to ur source(like io, sql and net packages) The classpath is one where, u need specify the path of the jvm to ur class file Read More
Why java is not 100% object oriented language??
Added on Wed, Dec 30, 2009
java is purly object oriented programinglanguage because u said that primitivr data types like int and char are used but these int ,char and soon are the objects of class Class plase refer to api document of j2se Read More
What is the difference between Class.forName and registerDriver()
Added on Wed, Dec 30, 2009
RegisterDriver() registers the JDBC driver with the DriverManager class. Class.forName() first loads the respective driver into the memory, registers the driver with the Driver Manager class and then creates an instance of the driver to carry... Read More
Have you used any version control?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the functionality of the stub?
Added on Wed, Dec 30, 2009
Stub: Stub is a client side representative.The functionality of stub is Marshalling and Unmarshalling in RMI(Remote method invocation). Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
What advantage do Java's layout managers provide over traditional windowing systems?
Added on Wed, Dec 30, 2009
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accomodate platform-specific differences... Read More
What is innerclass
Added on Wed, Dec 30, 2009
An inner class is a type of nested class that is not explicitly or implicitly declared static. Types of Inner Classes: Local inner class. Anonymous inner class. Non-static member class. Member Inner class. Read More
How and when to prevent inheritance?
Added on Wed, Dec 30, 2009
How to preventing inheritance:by a class declared as final then that calss cannot be inheritedwhen preventing the inheritance:suppose iy ur class no need to reused then only u can declare final . Read More
What is meant by distributed Application. Why we are using that in our applications?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is meant by Servelet. What are the parameters of the service method
Added on Wed, Dec 30, 2009
A Servlet is a component that extends the functionality the server. The service() method of the servlet takes in 2 paramaters HttpServletRequest and the HttpServletResponse objects. Read More
What restrictions are placed on the location of a package statement within a source code file?
Added on Wed, Dec 30, 2009
A package statement must appear as the first line in a source code file (excluding blanklines and comments). Read More
How will you pass parameters in RMI. Why u serialize
Added on Wed, Dec 30, 2009
Parameter are passed in RMI using Parameter marshalling. As RMI is used to invoke remote objects, many of the times objects, their references have passed across the network. Hence these objects need to be serialized. Read More
What is difference between runnable and thread ?
Added on Wed, Dec 30, 2009
Question : What is difference between runnable and thread ? why we use static class Answers: Difference between Runnable interface and Thread comes with in the main() method.If our class is... Read More
Does garbage collection guarantee that a program will not run out of memory?
Added on Wed, Dec 30, 2009
Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to... Read More
What is marker interface?Tell name of atleast three one?
Added on Wed, Dec 30, 2009
One of the "clean" features of the Java programming language is that it mandates a separation between interfaces (pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes. Often... Read More
Can we send object using Sockets
Added on Wed, Dec 30, 2009
Yes , We can send objects using a Socket. Read More
What significance of protected Constructors?
Added on Wed, Dec 30, 2009
Consider Class A extends Class B. If Class B has protected constructors then 1.Cannot create object from Class A directly. 2.Indirectly you can create object of Class A by instantialting Class B. Read More
In a Container there are 5 components. I want to display the all the components names, how will you do that?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How do you sing an Applet?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How you can know about drivers and database information
Added on Wed, Dec 30, 2009
Java API contains the class DriverManager and the interface Driver in java.sql package. This class provides information about the drivers and database to connect. Read More
Expain about the AJAX technology in Java that is very HOT in software market.
Added on Wed, Dec 30, 2009
AJAX stands for Asynchronous JavaScript And XML. Without AJAX, client has to submit the web page to interact with the server. But using AJAX, client side Java Script code can call server asynchronously and receive the results in an XML format.... Read More
Write a program on RMI and JDBC using Stored Procedure?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What value does readLine() return when it has reached the end of a file
Added on Wed, Dec 30, 2009
It does not return null value. it return -1when it reaches the end of file Read More
Have you used threads in Servlet?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is JVM
Added on Wed, Dec 30, 2009
JVM is a platform-independent programming language that converts Java bytecode into machine language and executes it. Read More
What is Singleton class
Added on Wed, Dec 30, 2009
A singleton is a class for which only one instance can exist within a program. In other words, only one, single object of that particular class can be created in a program. Read More
What are wrapper classes
Added on Wed, Dec 30, 2009
Wrapper classes are used to convert one data type into another data type Read More
What are the Differences between Tread class and Runnable ?
Added on Wed, Dec 30, 2009
Thread class is a class having defined methods for thread implementation & runnable is an interface where methods needs to be defined as required Read More
What modifiers may be used with an inner class that is a member of an outer class?
Added on Wed, Dec 30, 2009
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract. Read More
What is meant by Servelet. What are the parameters of the service method?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is collction framework?How it is working?Explain
Added on Wed, Dec 30, 2009
Collection framework provides set of classes and interfaces to work with group of objects. The collection framework mainly provieds three interface classes Set, List, and Map. Set's Implementation are HashSet, TreeSet and LinkedHashSet.... Read More
What are the Normalization Rules. Define the Normalization
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
Why java is not pure object oriented language
Added on Wed, Dec 30, 2009
For a pure object oriented language,there should be 6 features available with it.They are:- 1.Encapsulation/Information Hiding 2.Inheritance 3.Polymorphisms/Dynamic Binding 4.All pre-defined types should be Objects 5.All operations performed... Read More
When a thread blocks on I/O, what state does it enter
Added on Wed, Dec 30, 2009
When a thread blocks on I/O, it enters to BLOCKED state. A thread enters WAITING state, while a thread calls wait(), and it will come back to READY state, while other threads call notify() or notifyAll(). The wait-notify model is called monitor... Read More
What is a string Handling? How to use it? what is difference b/w Event handling
Added on Wed, Dec 30, 2009
No answer available currently. Be the first one to reply to this question by submitting your answer from the form below. Read More
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Added on Wed, Dec 30, 2009
The digits 0 through 9 may not be used as the first character of an identifier but they maybe used after the first character of an identifier. Read More
What is the difference between java script and java langauge.
Added on Wed, Dec 30, 2009
Java language can stand on its own and creates "standalone" applications while JavaScript must be placed inside an HTML document to function. Java must be compiled into what is known as a "machine language" before it can be run. You can alter... Read More
What is the order of method invocation in an Applet
Added on Wed, Dec 30, 2009
Following is the order of invocation: 1) init(); 2) start(); 3) stop(); 4) destroy(); Read More
What are the objects that are not subject to garbage collection
Added on Wed, Dec 30, 2009
String object are immutable so they are not garbage collected all kinds of objects are garbage collected except string object so try to avoid the usage of string objects in a large application Read More
What is working of bean in EJB
Added on Wed, Dec 30, 2009
An enterprise Bean is a body of code with fields and methods to implement modules of business logic. Client programs interact with one or more Beans, and an enterprise Bean can be implemented to interact with other enterprise Beans. An enterprise... Read More
What is default Buffersize of any Bufferedclass?
Added on Wed, Dec 30, 2009
Default buffer size is 16characters Read More
What are native methods? How do you use them?
Added on Wed, Dec 30, 2009
Native methods are methods that are defined as public static methods within a java class, but whose implementation is provided in another programming language such as C. Read More
What is the difference between Java API & Applets.
Added on Wed, Dec 30, 2009
The Java API (Application Programming Interface) is like a super dictionary of the Java language. It has a list of all Java packages, classes, and interfaces; along with all of their methods, fields and constructors; and also with information on how... Read More
vwhat are the other ways to prevent a class from being subclassed.one way is to declare the class final.
Added on Wed, Dec 30, 2009
Question : what are the other ways to prevent a class from being subclassed.one way is to declare the class final. does declaring a class private prevent it from being subclassed? Answers: I just tried out compiling a class... Read More
What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?
Added on Wed, Dec 30, 2009
Synchronize is used when u want to make ur methods thread safe. The disadvantage of synchronise is it will end up in slowing down the program. Also if not handled properly it will end up in dead lock. 1. Only use (and minimize it's use... Read More
What is the exact difference in between Unicast and Multicast object. Where we will use?
Added on Wed, Dec 30, 2009
The difference between unicast and multicast is that in unicast approach the sender sends the data stream to a single receiver at a time. Thus there is one to one communication. In a multicast the sender and the interested receivers communicate.... Read More
Please Give me an example for User defined Exception
Added on Wed, Dec 30, 2009
class NoMoneyException extends Exception{ public NoMoneyException(String m){super(m);}} public class Bank { public static void main(String[] args) throws NoMoneyException{ int b=5000,wd=15000; if(b>wd){System.out.println("Enjoy");} else ... Read More
How will you pass parameters in RMI. Why u serialize?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is static class
Added on Wed, Dec 30, 2009
By using static inner classes, you can add additional support functionality to your systems for capabilities such as testing, while incurring no penalties in normal, production deployment Read More
Why there is no guarentee for System.gc() method will perform garbage collection for a particular time?
Added on Wed, Dec 30, 2009
Not necessarily does it wait for the memory to be fully allocated. The garbage collection thread is looking at what percentage of available memory is already allocated..and if the memory allocation goes above a perticular level..say 80 %, the gc... Read More
What do you mean by marker interfaces? While no methods are presented in the marker interfaces,then what is the need of having them? In what circumstances we will use marker interfaces?
Added on Wed, Dec 30, 2009
One of the "clean" features of the Java programming language is that it mandates a separation between interfaces (pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes.Often you... Read More
Java says "write once, run anywhere". What are some ways this isn't quite true?
Added on Wed, Dec 30, 2009
Any time you use system calls specific to one operating system and do not create alternative calls for another operating system, your program will not function correctly. Solaris systems and Intel systems order the bits of an integer differently. ... Read More
What is the difference between classpath and path variable?
Added on Wed, Dec 30, 2009
Classpath: The CLASSPATH is an environment variable that tells the Java compiler javac. exe where to look for class files to import or java.exe where to find class files to interpret. Path: The PATH is an environment variable that tells the... Read More
What is the relationship between Home Interface and JNDI?
Added on Wed, Dec 30, 2009
I beleave this question is belonging to ejb. Home interface is an interface acts like a create factory. JNDI is stands java naming domin interface. Read More
If we have two public classes in a single java file ,how i have to give the name of the particular java file and how i can compile it?
Added on Wed, Dec 30, 2009
As per the Java convention and guide lines every class declared as public must be defined individually in a single file. If we have two public classes then we need to have to separate files for them. We can not put them in a single Java file. If you... Read More
Is there any difference between Execution Engine and the JIT in java??
Added on Wed, Dec 30, 2009
JIT means Just In Time compiler.The JIT used to compile java source file and generate class files.The execution engine means Java Virtual Machine( JVM) which executes the class files Read More
What is Constructor and Virtual function. Can we call Virtual funciton in a constructor?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How single threaded model works after implementation in class, basically architecture point of view.
Added on Wed, Dec 30, 2009
The Single Thread Model is an interface which is used to indicate that only a single thread will execute the service( ) method of a servlet at a given time. It defines no constants and declares no methods. If a servlet implements this interface, the... Read More
What is interface? and what is the purpose of it?
Added on Wed, Dec 30, 2009
Question : What is interface? and what is the purpose of it? Iknow lot of people having problem in this question(even i have it). so i request some good answer to come.I need a good example for the purpose of interface ... Read More
When we will use an Interface and Abstract class
Added on Wed, Dec 30, 2009
Interfaces are used when we have to develop distributed applications or when we need to implement multiple inheritence. While abstract classes will be used when we need to develop a standalone application. Read More
WHEN UR USING ARRAYLIST AND LIKEDLIST AND VECTOR AND HASHMAP AND HASHTABLE?
Added on Wed, Dec 30, 2009
All are use when we want to handle Objects, alougth difference is ArrayList contains objects in any order while with LinkList objects are stored in the order which you entered, but both are not thread safe. Vector is similar to ArrayLias but is... Read More
When programmer using the vector and arrylist? and when ur using linkedlist and hashmap and hashtable?
Added on Wed, Dec 30, 2009
ArrayList is not Synchronized. Hence in multithreaded programming use ArrayList While Vector is Synchronized. So if we have a Banking ATM transaction where u dont want 2 people to access the same account at the same time in 2 different m/c use Vector... Read More
Can wehave run() method directly without start() method in threads?
Added on Wed, Dec 30, 2009
Start method is method of Thread which is implemented for create and run thread. Which will call run() where you put your implementation. If you directly call run() method it is just normal method call and not a new thread. That call will be in main... Read More
What are interfaces?
Added on Wed, Dec 30, 2009
To incorporate multiple inheritence in Java Application. 2. To Develop Distributed applications. Interfaces provide more sophisticated ways to organize and control the objects in your system. The interface keyword takes the abstract concept one... Read More
What is serialization
Added on Wed, Dec 30, 2009
In the Java world, serialization is the storing of an object's current state on any permanent storage media for later reuse. This is done using when you use the seriazlizable interface or when using the ObjectOutputStream and ObjectInputStream... Read More
What is JNI
Added on Wed, Dec 30, 2009
Java Native Interface: It defines the way that a Java program can call programs written in languages like C. Read More
How will you pass values from HTML page to the Servlet
Added on Wed, Dec 30, 2009
There are some ways to Pass a value from a Html page to the servlet.. 1. hidden variable 2. appending to the link by usign name value pair. Read More
Which class is the super class for all classes in java.lang package?
Added on Wed, Dec 30, 2009
The object class is super or boss class of all classes in java all the classes by default extends this class and can uses the methods of these classexmp. equals,compareto etc Read More
What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection?
Added on Wed, Dec 30, 2009
This site is very useful for freshers yor are applying for the jobs in software side and also useful to gain knowledge in programming side and we know about the all programming language and gaining with important hints and important question its... Read More
What is the difference between paint() and repaint() methods
Added on Wed, Dec 30, 2009
Paint is called for the first time the applet is loaded, whereas repaint method is called everytime the applet is refreshed. Read More
What do you know about the garbate collector
Added on Wed, Dec 30, 2009
Garbage collection is one of the features of java... Java provide automatically releasing of the object if that is no longer in the use. so that the memory can be used by some other object.. garbage collector collect the oblect only those whose... Read More
What is JVM Heap Size? How does it affect the performance of the Application?
Added on Wed, Dec 30, 2009
The heap is the runtime data area from which memory for all class instances and arrays is allocated. The heap may be of a fixed size or may be expanded. The heap is created on virtual machine start-up. If you have complicated algorithms or big... Read More
We know that Object class is super class of every class & a class extends only one class. so
Added on Wed, Dec 30, 2009
Question : We know that Object class is super class of every class & a class extends only one class. so how is it possible to a class to extend other than Object class? Answers: case 1 suppose you have a class Test,... Read More
Why does not support multiple Inheritance
Added on Wed, Dec 30, 2009
Coz after extends keyword you can specify only one class name, coz no default delimerters are present in java Read More
What you know about Corba implementation in Java?
Added on Wed, Dec 30, 2009
Java 1.2 promises full CORBA IDL support. Read More
What is Java Beans?
Added on Wed, Dec 30, 2009
According to JavaSoft, "A Java Bean is a reusable software component that can be manipulated visually in a builder tool." Read More
Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times. Where 3 processes are started or 3 threads are started
Added on Wed, Dec 30, 2009
(i guess) This depand on the operating system. like windows Xp support support multithreading. so if you startig a 3 notepad in XP it's treated as three threads. Read More
if interface & abstract class have same methods & abstract class also not contain any implementation for those methods which one you prefer ?
Added on Wed, Dec 30, 2009
Obviously one should ideally go for an interface.Coz as we all know one can only extend just 1 class , where as one can implement as many interfaces as one can.And in case the class under contention has got some threads to invoke or if it is some... Read More
What modifiers may be used with a top-level class
Added on Wed, Dec 30, 2009
The following modifiers may be used with a top-level class: private, protected or public access modifiers and/or either abstract or final (not both). Read More
Diff between Application and Applet?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is difference between array & arraylist?
Added on Wed, Dec 30, 2009
ArrayList is a part of the Collection Framework.We can store any type of objects, and we can deal with only objects.It is growable.Array is collection of similar data items.We can have array of primitives or objects.It is of fixed size,We can have... Read More
Can I modify an object in CORBA?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is difference between java.lang .Class and java.lang.ClassLoader? What is the hierarchy of ClassLoader
Added on Wed, Dec 30, 2009
A Class is nothing but a byte code which will be generated when you compile a java file. And it is required to execute your java file. Where as a ClassLoader is also a class which loads the class files into memory in order for the Java programs to... Read More
What is garbage collection
Added on Wed, Dec 30, 2009
Java provide a automatic clean up of object if that object referecne counter becomes zero. and this is done by the garbage collector. this will invoke automatically and free all those resources(object) who is not been use for a long time.. Read More
How can we use hashset in collection interface?
Added on Wed, Dec 30, 2009
This class implements the set interface, backed by a hash table (actually a HashMap instance). It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time. This class... Read More
Why clonning method is private?
Added on Wed, Dec 30, 2009
Question : Why clonning method is private? can u overload the main() method. 2)can overload the run() method. 3)what is Common Separated value. Answers: in java objects are created by 2 methodes, 1>by creating... Read More
What is the functionality stubs and skeletons?
Added on Wed, Dec 30, 2009
Stub: Stub is a client side proxy. Skeleton: Skeleton is server side proxy. The functionality of stub and skeleton is Marshalling and Demarshalling. Marshalling : It is a process of converting the java data into byte stream. Demarshalling:... Read More
why java does not support inheritance of multiple superclasses
Added on Wed, Dec 30, 2009
Question : why java does not support inheritance of multiple superclasses? what is achieved by inheritance? why there is no main method in servlets/jsps? Answers: Handling the two classes always be a... Read More
What is collection framework?what interfaces and
Added on Wed, Dec 30, 2009
Question : What is collection framework?what interfaces and classes support collection framework? Answers: A Collection Framework is a generic types which you use to create collection classes that support... Read More
What is the protocol used by server and client?
Added on Wed, Dec 30, 2009
Hyper text transfer protocol(HTTP) is used for communication between client and server. Submitted by Chinnakotla Devarathnam (devarathnam@yahoo.co.in) Read More
what is difference between instance and object.?
Added on Wed, Dec 30, 2009
Question : what is difference between instance and object.? what are the all difference between interface and abstract class? Answers: Instance means just creating a reference(copy) . object :means when memory location... Read More
What are the files generated after using IDL to Java Compilet?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is Difference between AWT and Swing
Added on Wed, Dec 30, 2009
AWT is a "Heavy weight" component require native OS. Swing components are called "lightweight" because they do not require a native OS object to implement their functionality. Read More
What is the difference between String and StringBuffer? Which is better to use in project?
Added on Wed, Dec 30, 2009
When a String is created, it is not destroyed. It remains in the pool of memory and whenever that string is referred, the JVM searches for the String from the string pool of memory and gets the relevant data. So as such String is expensive... Read More
What is JFC
Added on Wed, Dec 30, 2009
The Java Foundation Classes (JFC) are a set of GUI components and other services simplifying the development and deployment of desktop and Internet/ Intranet applications. Java Foundation Classes (JFC) Read More
What is the RMI and Socket?
Added on Wed, Dec 30, 2009
RMI: REMOTE METHOD INVOCATION(RMI) it is a mechanism to invoke the methods from one JVM( Java virtual machine) to another JVM. SOCKET:It is a perfect end point.Mainly it is used in the networking.or it is a destination point. Submitted by... Read More
what is a green thread?
Added on Wed, Dec 30, 2009
Daemon thread is a kind of threads: normally it will run forever, but when all other non-daemon threads are dead, daemon thread will be killed by JVM Read More
Can we send object using Sockets?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is JIT? Is it bundled with JDK? If so what is the role of interpreter(java)? plz explain in detail.
Added on Wed, Dec 30, 2009
JIT is just-in-time. Yes JIT is bundled with JDK. Compiler converts .java file into .class file then interpreter reads bytecodes and that's why JIT. Read More
What is difference in between Java Class and Bean?
Added on Wed, Dec 30, 2009
The code in a static block is loaded/executed only once i.e. when the class is first initialized. A class can have any number of static blocks. Static block is not member of a class, they do not have a return statement and they cannot be called... Read More
When exactly a static block is loaded in Java ?
Added on Wed, Dec 30, 2009
The code in a static block is loaded/executed only once i.e. when the class is first initialized. A class can have any number of static blocks. Static block is not member of a class, they do not have a return statement and they cannot be called... Read More
What is bean. Where it can be used?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
When is update method called
Added on Wed, Dec 30, 2009
The "update" method is an internal method belonging to one of " applet's" parent-classes. When you call "repaint" this method is called. It Read More
How we know a class is Serialized or not from a package
Added on Wed, Dec 30, 2009
where and when we use abstract class and abstract methods Read More
What is the difference between RMI & Corba
Added on Wed, Dec 30, 2009
RMI is completely Java based, where CORBA is language independant. There are many adapters for CORBA, and programs can call processes written in any language that has a CORBA interface. CORBA has many more features documented in the specification... Read More
When will a static variable is loaded?is it at compile time or runtime?
Added on Wed, Dec 30, 2009
Static variable are loaded when classloader brings the class to the JVM. It is not neccessary that an object has to be created. When u access any of the static variable or static methods then the class will be loaded. Read More
How do you communicate in between Applets & Servlets
Added on Wed, Dec 30, 2009
The simplest way for an applet to exchange information with a servlet is through an HTTP text stream. Another, less common strategy for applet-to-servlet communication is to create a raw socket connection from the applet back to the servlet. Read More
While developing one in JSP page we are sending request to Struts frame work.If we click two times submit button then First time only it should accept request and second time should reject that request in struts frame work.
Added on Wed, Dec 30, 2009
Question : While developing one in JSP page we are sending request to Struts frame work.If we click two times submit button then First time only it should accept request and second time should reject that request in struts frame work. How... Read More
Canweimplement aninterface in JSP Page?If yesHow?write thecode?
Added on Wed, Dec 30, 2009
we can't implement interface in JSP. This one of the major difference between Servlet's and JSP's. Read More
What is the corresponding Layout for Card in Swing?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between Process and Threads
Added on Wed, Dec 30, 2009
A process is an OS-level task or service. A thread runs "inside" a process and may be virtual or simulated. Generally speaking, threads share resources like memory, where processes each have their own separate memory area, and need to take more... Read More
How will you add panel to a Frame?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is user defined exception
Added on Wed, Dec 30, 2009
Java supports exception handling by its try catch constructs. Java API define exception classes for such conditions. These classes are derived from java.lang.Throwable class. User defined exceptions are those exceptions which an application... Read More
What are the modules in a J2EE application
Added on Wed, Dec 30, 2009
J2EE application modules (.ear), EJB modules (.jar) and web application modules (.war). Read More
Constructor can not be inherited.Why? Tell me the reason.
Added on Wed, Dec 30, 2009
Constructor can not be inherited because inheritance feature is only available for class not for methods (constructor is nothing but method) and all methods of super class is available for sub-class. Read More
What is the Layout for ToolBar?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What are the tiers in J2EE architecture
Added on Wed, Dec 30, 2009
In a j2ee application there are possibly following tiers. Client Tier - Contains client side applets. Web Tier - Contains web components jsp, servlets. Application tier - contains business logic ejbs. Legacy Application tier -... Read More
Where the CardLayout is used?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
Why pointers are not used in java
Added on Wed, Dec 30, 2009
Funda ? Dynamic Memory Management. Some of the important differences between Java and C or C++ is how they handle memory. Java eliminates pointers and adds garbage collection and true arrays to the language. C uses pointers for memory management... Read More
What is J2EE
Added on Wed, Dec 30, 2009
Java 2 Platform, Enterprise Edition (J2EE) defines the standard for developing component-based multitier enterprise applications. Read More
I studied that "Abstract class means ,it doesn't maintain the complete information about the particular class". Is it right? Justify?
Added on Wed, Dec 30, 2009
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is... Read More
What is UML patterns?give me clear explanation
Added on Wed, Dec 30, 2009
UML provide us notation and keywords. Read More
What are the benefits of Swing over AWT?
Added on Wed, Dec 30, 2009
Benifits of Swing over AWT: 1.Swing is a peerbased technology. 2.Swing allows light-weight components. 3.Swing components are "look and feel." 4.Swing components lightly dependent on underlaying domain. 5.Swing components will be appeared as... Read More
What is class loader
Added on Wed, Dec 30, 2009
A class loader is an object that is responsible for loading classes.The class ClassLoader is an abstract class. Read More
What are the various access modifiers in Java. Differences between them
Added on Wed, Dec 30, 2009
There are four levels of access specifiers in Java. They are Public, Private and Protected. an default. PUBLIC: If the method or the variable is declared public, then it will be visible to all classes of the program. PRIVATE: If the method or the... Read More
What is Anonymous class,Singleton Class and Assertions?
Added on Wed, Dec 30, 2009
Anonymous: instantiating the class without object name. Singleton: it can instantiated by only one time. Assertions: to show warning to the user. Read More
What is difference RMI registry and OSAgent?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between a Scrollbar and a ScrollPane?
Added on Wed, Dec 30, 2009
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. AScrollPane handles itsown events and performs its own scrolling. Read More
What is the difference between yielding and sleeping
Added on Wed, Dec 30, 2009
When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state. Read More
What is the statament we need to use particularly when using type2 and type 4 drivers( example for type 1 jdbc.odbc.JdbcOdbcDriver)?
Added on Wed, Dec 30, 2009
Type1: sun.jdbc.odbc.JdbcOdbcDriver type4(thinDriver):jdbc:"oralce:thin:@localhost:1521:oracle","scott","tiger") It is fastest Driver,it uses java sockets to direct connect with oracle.it is 100%pure java.this is 100% platform independent. Read More
What is the difference between InputStream/Outputstream classes
Added on Wed, Dec 30, 2009
An input stream produces a stream of characters; an output stream receives a stream of characters, ?one at a time.? Read More
How to Synchronize the HashMap
Added on Wed, Dec 30, 2009
The solution is Map m=Collections.synchronizedMap(new HashMap(..))---ramanan-- Read More
Suppose server object is not loaded into the memory, and the client requests for it, what will happen?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between HashMap and TreeMap
Added on Wed, Dec 30, 2009
The difference is that a HashMap stores all of its data inside of a hash table while a TreeMap stores all of its information in a tree. Read More
What is the difference between applet and application
Added on Wed, Dec 30, 2009
In simple terms, an applet runs under the control of a browser, whereas an application runs stand-alone, with the support of a virtual machine. As such, an applet is subjected to more stringent security restrictions in terms of file and network... Read More
How will you perform transaction using JDBC?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval Read More
What is the difference between Comparable and Comparator
Added on Wed, Dec 30, 2009
The Comparable is for natural ordering and Comparator is for custom ordering. But we can override the compareTo method of comparable interface to give a custom ordering. Read More
What is the difference between tomact and weblogic
Added on Wed, Dec 30, 2009
WEBLOGIC: is a application server. Supports many protocols. Used for enterprise applications and EJBs. Supports N-Tier architectures. Provides more scalability. TOMCAT: is a web server supports only HTTP / HTTPS protocols Used for... Read More
Why java does not support multiple inheritance.why we go for interfaces
Added on Wed, Dec 30, 2009
Because the multiple inheritance causes the redundancy coz the size of the childs increases Suppose node derived from the multiple node causes the same method will be inherited in the that node so avoid redundancy.... In interfaces we just have... Read More
What is a layout manager? s
Added on Wed, Dec 30, 2009
A layout manager is an object that is used to organize components in a container. Read More
How you can know about drivers and database information?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is the difference between Model Data and
Added on Wed, Dec 30, 2009
Question : What is the difference between Model Data and Default Model Data Answers: Modal Data is a interface while DefaultModalData is a abstract class which implements ModalData. Read More
What is the functionality of try, catch and finally blocks
Added on Wed, Dec 30, 2009
The simple Try statement comes before the block of code, the Catch block of code is where we specify what type of error to look for, and the Finally block of code is always executed and contains cleanup routines for exception situations. Since the... Read More
What is the purpose of finalisation
Added on Wed, Dec 30, 2009
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. Read More
How can we emplement strutsframework using jsp or servlets.
Added on Wed, Dec 30, 2009
Struts Framework based on MVC Design pattern.M, the model Component which has all the business logic in it and V - View is for the Presentation. Jsps form the presentation part of it. JSPs contain any combination of Struts custom tags.The org.apache... Read More
Why do you Canvas?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is Reflection. Uses of Reflection
Added on Wed, Dec 30, 2009
Reflection is an advanced feature of the Java environment. It gives runtime information about objects, classes, and interfaces. Uses :Constructing an object using a given constructor Invoking an object's method using such-and-such... Read More
Is there any tag in HTML to upload and download files?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How i can validate the user, Is there any java api is there for that. Or i can use my one business logic. If both are possible, Then which one is the best way for real time.
Added on Wed, Dec 30, 2009
In think there is no direct mechanism to provide validatations. If you are talking about the Swing/AWT the validations there is no API as of my knowlege. But when u talk about web based applcations most of the validations are done with the... Read More
How will you call an Applet using a Java Script function?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
How does thread synchronization occurs inside a monitor?
Added on Wed, Dec 30, 2009
If you have the better answer, then send it to us. We will display your answer after the approval. Read More
What is JavaMail
Added on Wed, Dec 30, 2009
Java Mail Api provides capability to a java application. to read and write emails using smtp , pop3 , imap etc Read More
Why should i use ejb as i can do it in servlet?
Added on Wed, Dec 30, 2009
Servlet can not be used as a business logic component which EJB can be used. Read More
How We Can We write our own exceptions?
Added on Wed, Dec 30, 2009
To write our own Exception class 1)Our class must be subclass of Throwable or Exception class 2)Evert Exception class provide 2 constructors a) no arguments b) one argument i.e String argument 3) Optional: Overidding toString metod of... Read More
What interface must an object implement before it can be written to a streamas an object?
Added on Wed, Dec 30, 2009
An object must implement the Serializable or Externalizable interface before it can bewritten to a stream asan object. Read More
What is Synchronisation in threads
Added on Wed, Dec 30, 2009
If two threads can both execute a method that modifies the state of an object then the method should be declared to be synchronized, allowing only one thread to execute the method at a time. Read More
What is the base class for all swing components?
Added on Wed, Dec 30, 2009
All swing components are derived from abstract javax.swing.Jcomponet class. Read More
What are the benefits of Swing over AWT
Added on Wed, Dec 30, 2009
since swings are light weight components and AWT is heavy weight component swings are fster than AWT and swings are platform independent were as AWT is not platform independent Read More
what is the difference between putting a class as abstract or if any of method in class is declared as abstract diference of these two while extending these two types of classes
Added on Wed, Dec 30, 2009
class is declared abstract for extended clarity. If any method in the class is declared abstract then the class has to be declared abstract and the method has to be implemented in the following derived class. Read More
|
| ©2007, 1000projects.com, Only For Educational Purpose, Non Commercial use! |
|
 |
 |