• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Java Interview Questions Answers

Question - 111 : - What is the purpose of the System class?

Answer - 111 : - The purpose of the System class is to provide access to system resources.

Question - 112 : - What is the difference between the >> and >>> operators?

Answer - 112 : - The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out.

Question - 113 : - What is the Collections API?

Answer - 113 : - The Collections API is a set of classes and interfaces that support operations on collections of objects.

Question - 114 : - How to create a thread in a program?

Answer - 114 : - You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread.

Question - 115 : - What is the difference between a Window and a Frame?

Answer - 115 : - The Frame class extends Window to define a main application window that can have a menu bar.

Question - 116 : - What is synchronization and why is it important?

Answer - 116 : - With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors.

Question - 117 : - Does a class inherit the constructors of its super class?

Answer - 117 : - A class does not inherit constructors from any of its superclasses.

Question - 118 : - What is the difference between final, finally and finalize?

Answer - 118 : - Short answer: final - declares constant finally - relates with exception handling finalize - helps in garbage collection If asked to give details, explain: final field, final method, final class try/finally, try/catch/finally protected void finalize() in Object class

Question - 119 : - What is the output of x > y? a:b = p*q when x=1,y=2,p=3,q=4?

Answer - 119 : - When this kind of question has been asked, find the problems you think is necessary to ask back before you give an answer. Ask if variables a and b have been declared or initialized. If the answer is yes. You can say that the syntax is wrong. If the statement is rewritten as: x

Question - 120 : - Can you make an instance of an abstract class? For example - java.util.Calender is an abstract class with a method getInstance() which returns an instance of the Calender class.

Answer - 120 : - No! You cannot make an instance of an abstract class. An abstract class has to be sub-classed. If you have an abstract class and you want to use a method which has been implemented, you may need to subclass that abstract class, instantiate your subclass and then call that method.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners