Question-148:What are wrapper classes?
Answer:
Wrapper classes are classes that allow primitive types to be accessed as objects.
Question-149: What is a native method?
Answer:
A native method is a method that is implemented in a language other than Java.
Question-150: What is the purpose of the System class?
Answer:
The purpose of the System class is to provide access to system resources.
Question-151: What comes to mind when someone mentions a shallow copy in Java?
Answer:
Object cloning.
Question-152: What is singleton class?
Answer:
Singleton class means that any given time only one instance of the class is present, in one JVM. AWT and SWING Interview Questions
Question-153: Which containers use a border layout as their default layout?
Answer:
The Window, Frame and Dialog classes use a border layout as their default layout.
Question-154: Which containers use a FlowLayout as their default layout?
Answer:
The Panel and Applet classes use the FlowLayout as their default layout.
Question-155: What are peerless components?
Answer:
The peerless components are called light weight components.
Question-156: Is the difference between a Scrollbar and a ScrollPane?
Answer:
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.
Question-157: What is a lightweight component?
Answer:
Lightweight components are the one which doesn?t go with the native call to obtain the graphical units. They share their parent component graphical units to render them. For example, Swing components.
Question-158: What is a heavyweight component?
Answer:
For every paint call, there will be a native call to get the graphical units.For Example, AWT.
Question-159: What is an applet?
Answer:
An applet is a small java program that runs inside the browser and generates dynamic contents.
Question-160: Can you write a Java class that could be used both as an applet as well as an application?
Answer:
Yes. Add a main() method to the applet.
Answer:
Wrapper classes are classes that allow primitive types to be accessed as objects.
Question-149: What is a native method?
Answer:
A native method is a method that is implemented in a language other than Java.
Question-150: What is the purpose of the System class?
Answer:
The purpose of the System class is to provide access to system resources.
Question-151: What comes to mind when someone mentions a shallow copy in Java?
Answer:
Object cloning.
Question-152: What is singleton class?
Answer:
Singleton class means that any given time only one instance of the class is present, in one JVM. AWT and SWING Interview Questions
Question-153: Which containers use a border layout as their default layout?
Answer:
The Window, Frame and Dialog classes use a border layout as their default layout.
Question-154: Which containers use a FlowLayout as their default layout?
Answer:
The Panel and Applet classes use the FlowLayout as their default layout.
Question-155: What are peerless components?
Answer:
The peerless components are called light weight components.
Question-156: Is the difference between a Scrollbar and a ScrollPane?
Answer:
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.
Question-157: What is a lightweight component?
Answer:
Lightweight components are the one which doesn?t go with the native call to obtain the graphical units. They share their parent component graphical units to render them. For example, Swing components.
Question-158: What is a heavyweight component?
Answer:
For every paint call, there will be a native call to get the graphical units.For Example, AWT.
Question-159: What is an applet?
Answer:
An applet is a small java program that runs inside the browser and generates dynamic contents.
Question-160: Can you write a Java class that could be used both as an applet as well as an application?
Answer:
Yes. Add a main() method to the applet.
No comments:
Post a Comment