Content-Length: 3117059 | pFad | https://www.scribd.com/document/635104421/Top-100-Java-Interview-Qns-Ans
1Top 100 Java Interview Qns & Ans
Top 100 Java Interview Qns & Ans
Top 100 Java Interview Qns & Ans
2. What is a JVM?
Answer: JVM is Java Virtual Machine which is a run time environment for the compiled java class files.
8. What restrictions are placed on the location of a package statement within a source code file?
Answer: A package statement must appear as the first line in a source code file (eliminating blank lines
and comments).
9. What method is used to specify a container’s layout?
Answer: The setLayout() method is used to specify a container’s layout.
26. Which java. util classes and interfaces support event handling?
Answer: The Event Object class and the Event Listener interface support event processing.
31. What’s new with the stop(), suspend() and resume() methods in JDK 1.2 ?
Answer:
These methods have been deprecated in JDK 1.2.
33. What is the difference between the >> and >>> operators?
Answer: The >> operator carries the sign bit when shifting right while the >>> zero-fills bits that have
been shifted out.
34. What is the difference between this() and super()?
Answer: this() can be used to invoke a constructor of the same class whereas super() can be used to
invoke a super class constructor.
36. What value does read Line() return when it has reached the end of a file?
Answer:The readLine() method returns null when it has reached the end of a file.
Answer: The Java API is a large collection of ready-made software components that provide many
usefulcapabilities, such as graphical user interface (GUI) widgets.
Answer: Global variables are globally accessible. Java does not support globally accessible variables due
to following reasons:
The global variables breaks the referential transparency
Global variables creates collisions in namespace.
Answer: public: Any thing declared as public can be accessed from anywhere. private: Any thing
declared asprivate can’t be seen outside of its class. protected: Any thing declared as protected can be
accessedby classes in the same package and subclasses in the other packages. default modifier : Can
beaccessed only to classes in the same package.
Fetched URL: https://www.scribd.com/document/635104421/Top-100-Java-Interview-Qns-Ans
Alternative Proxies: