>> Saturday, June 25, 2011
Q).Why threads block or enters to waiting state on I/O?
A).Threads enters to waiting state or block on I/O because other threads can execute while the I/O operations are performed.
Q).What are transient variables in java?
A).Transient variables are variable that cannot be serialized.
Q).What is synchronization
A).Synchronization is the ability to control the access of multiple threads to shared resources. Synchronization stops multithreading. With synchronization , at a time only one thread will be able to access a shared resource.
Q).What is List interface ?
A).List is an ordered collection of objects.
Q).What is a Vector
A).Vector is a grow able array of objects.
Q).What is the difference between yield() and sleep()?
A).When a object invokes yield() it returns to ready state. But when an object invokes sleep() method enters to not ready state.
Q).What are Wrapper Classes ?
A).They are wrappers to primitive data types. They allow us to access primitives as objects.
Q).Can we call finalize() method ?
A).Yes. Nobody will stop us to call any method , if it is accessible in our class. But a garbage collector cannot call an object's finalize method if that object is reachable.
Q).What is the initial state of a thread when it is created and started?
A).The thread is in ready state.
Q).Can we declare an anonymous class as both extending a class and implementing an interface?
A).No. An anonymous class can extend a class or implement an interface, but it cannot be declared to do both
Q).What is the use of the finally block?
A).Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. finally will not execute when the user calls System.exit().
Q). What is an abstract method ?
A). An abstract method is a method that don't have a body. It is declared with modifier abstract.
A).Threads enters to waiting state or block on I/O because other threads can execute while the I/O operations are performed.
Q).What are transient variables in java?
A).Transient variables are variable that cannot be serialized.
Q).What is synchronization
A).Synchronization is the ability to control the access of multiple threads to shared resources. Synchronization stops multithreading. With synchronization , at a time only one thread will be able to access a shared resource.
Q).What is List interface ?
A).List is an ordered collection of objects.
Q).What is a Vector
A).Vector is a grow able array of objects.
Q).What is the difference between yield() and sleep()?
A).When a object invokes yield() it returns to ready state. But when an object invokes sleep() method enters to not ready state.
Q).What are Wrapper Classes ?
A).They are wrappers to primitive data types. They allow us to access primitives as objects.
Q).Can we call finalize() method ?
A).Yes. Nobody will stop us to call any method , if it is accessible in our class. But a garbage collector cannot call an object's finalize method if that object is reachable.
Q).What is the initial state of a thread when it is created and started?
A).The thread is in ready state.
Q).Can we declare an anonymous class as both extending a class and implementing an interface?
A).No. An anonymous class can extend a class or implement an interface, but it cannot be declared to do both
Q).What is the use of the finally block?
A).Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. finally will not execute when the user calls System.exit().
Q). What is an abstract method ?
A). An abstract method is a method that don't have a body. It is declared with modifier abstract.
0 comments:
Post a Comment