More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. Suspend method is used to suspend thread which can be restarted by using resume() method. stop() is used to stop the thread, it cannot be restarted again.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Scanner class introduced in Java 1.5 for reading Data Stream from the imput device. Previously we used to write code to read a input using DataInputStream. After reading the stream , we can convert into respective data type using in.next() as String ,in.nextInt() as integer, in.nextDouble() as Double etc
Help us improve. Please let us know the company, where you were asked this question :
Ans. The accessibility (public, protected, etc.) of the inner class is defined by the outer class.
Just like top-level classes, an inner class can extend a class or can implement interfaces.
Similarly, an inner class can be extended by other classes, and an inner interface can be implemented or extended by other classes or interfaces.
An inner class can be declared final or abstract.Inner classes can have inner classes, but you will have a hard time reading or understanding such complex nesting of classes.
Help us improve. Please let us know the company, where you were asked this question :
Which of the following is not type of inner classes ?
Simple Inner Class
Static Nested Inner Class
Method Nested Static Inner Class
Anonymous Inner Class
Which of following can be nested into another ?
class within another class
class within interface
interface within class
All of above
Q136. What is the advantage of using arrays over variables ?
Ans. Arrays provide a structure wherein multiple values can be accessed using single reference and index. This helps in iterating over the values using loops.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It's a technique to allow multiple clients to make use of a cached set of shared and reusable connection objects providing access to a database or other resource.
Help us improve. Please let us know the company, where you were asked this question :
Q139. What is the difference between System.out ,System.err and System.in?
Ans. System.out and System.err both represent the monitor by default and hence can be used to send data or results to the monitor. But System.out is used to display normal messages and results whereas System.err is used to display error messages and System.in represents InputStream object, which by default represents standard input device, i.e., keyboard.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Java is a portable-language because without any modification we can use Java byte-code in any platform(which supports Java). So this byte-code is portable and we can use in any other major platforms.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   bytecode   jvm   compiler   portable   features of java   basic interview question
Ans. throw is used to explicitly throw an exception especially custom exceptions, whereas throws is used to declare that the method can throw an exception.
We cannot throw multiple exceptions using throw statement but we can declare that a method can throw multiple exceptions using throws and comma separator.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Object is a run time entity whose state is stored in fields and behavior is shown via methods. Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.
Help us improve. Please let us know the company, where you were asked this question :
Ans. A class is a blue print or Mold using which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It is part of the analysis of a program and describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  use cases   design   high level design   testing   test driven development   software system analyst   project lead basic   frequent
Q147. What is the difference between a break statement and a continue statement?
Ans. 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 the loop statement.
Help us improve. Please let us know the company, where you were asked this question :
Ans. An enumeration is an interface containing methods for accessing the underlying data structure from which the enumeration is obtained. It allows sequential access to all the elements stored in the collection.
Help us improve. Please let us know the company, where you were asked this question :
Ans. PATH is the variable that holds the directories for the OS to look for executables. CLASSPATH is the variable that holds the directories for JVM to look for .class files ( Byte Code ).
Help us improve. Please let us know the company, where you were asked this question :
Q157. Which of the following syntax are correct ?a. LinkedList<Integer> l=new LinkedList<int>();b. List<Integer> l=new LinkedList<int>();c. LinkedList<Integer> l=new LinkedList<Integer>();d. List<Integer> l = new LinkedList<Integer>();