Java Interview Questions - 7

In our earlier tutorial we have seen lot of Java interview questions and sample programs. In this tutorial we see similar set of interview questions and answers.

What state does a thread enter when it terminates its processing?


What is the Collections API?


Can a lock be acquired on a class?


What is the Vector class?


What modifiers may be used with an inner class that is a member of an outer class?


What is an Iterator interface?


What is the difference between the >> and >>> operators?


What's new with the stop(), suspend() and resume() methods in JDK 1.2?


Java Interview Questions - 7

Is null a keyword?


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?


What is the List interface?


what is a transient variable?


which containers use a border Layout as their default layout?


Why do threads block on I/O?


How are Observer and Observable used?


What is synchronization and why is it important?


What is the preferred size of a component?


What method is used to specify a container's layout?


Which containers use a FlowLayout as their default layout?


How does Java handle integer overflows and underflows?


Which method of the Component class is used to set the position and size of a component?


How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?


What is the difference between yielding and sleeping?


Which java.util classes and interfaces support event handling?


Is sizeof a keyword?


What are wrapped classes?


Does garbage collection guarantee that a program will not run out of memory?


What restrictions are placed on the location of a package statement within a source code file?


Can an object's finalize() method be invoked while it is reachable?


What is the immediate superclass of the Applet class?


What is the difference between preemptive scheduling and time slicing?


Name three Component subclasses that support painting.


What value does readLine() return when it has reached the end of a file?


What is the immediate superclass of the Dialog class?


What is clipping?


What is a native method?


Can a for statement loop indefinitely?


What are order of precedence and associativity, and how are they used?


When a thread blocks on I/O, what state does it enter?


To what value is a variable of the String type automatically initialized?


What is the catch or declare rule for method declarations?


What is the difference between a MenuItem and a CheckboxMenuItem?


What is a task's priority and how is it used in scheduling?


What class is the top of the AWT event hierarchy?


When a thread is created and started, what is its initial state?


Can an anonymous class be declared as implementing an interface and extending a class?


What is the range of the short type?


What is the range of the char type?


In which package are most of the AWT events that support the event-delegation model defined?


What is the immediate superclass of Menu?


What is the purpose of finalization?


Which class is the immediate superclass of the MenuComponent class.


What invokes a thread's run() method?


What is the difference between the Boolean & operator and the && operator?


Name three subclasses of the Component class.


What is the GregorianCalendar class?


Which Container method is used to cause a container to be laid out and redisplayed?


What is the purpose of the Runtime class?


How many times may an object's finalize() method be invoked by the garbage collector?


What is the purpose of the finally clause of a try-catch-finally statement?


What is the argument type of a program's main() method?


Which Java operator is right associative?


What is the Locale class?


Can a double value be cast to a byte?


What is the difference between a break statement and a continue statement?


What must a class do to implement an interface?


What method is invoked to cause an object to begin executing as a separate thread?


Name two subclasses of the TextComponent class.


What is the advantage of the event-delegation model over the earlier event-inheritance model?


Which containers may have a MenuBar?


How are commas used in the initialization and iteration parts of a for statement?


What is the purpose of the wait(), notify(), and notifyAll() methods?


What is an abstract method?


How are Java source code files named?


What is the relationship between the Canvas class and the Graphics class?


What are the high-level thread states?


What value does read() return when it has reached the end of a file?


Can a Byte object be cast to a double value?


What is the difference between a static and a non-static inner class?


What is the difference between the String and StringBuffer classes?


If a variable is declared as private, where may the variable be accessed?


What is an object's lock and which object's have locks?


What is the Dictionary class?


How are the elements of a BorderLayout organized?


What is the % operator?


When can an object reference be cast to an interface reference?


What is the difference between a Window and a Frame?


Which class is extended by all other classes?


Can an object be garbage collected while it is still reachable?


Is the ternary operator written x : y ? z or x ? y : z ?


What is the difference between the Font and FontMetrics classes?


How is rounding performed under integer division?


What happens when a thread cannot acquire a lock on an object?


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?


What classes of exceptions may be caught by a catch clause?


If a class is declared without any access modifiers, where may the class be accessed?


What is the SimpleTimeZone class?


What is the Map interface?


Does a class inherit the constructors of its superclass?


For which statements does it make sense to use a label?



No comments :

Post a Comment