Languages-Java [3i Infotech Placement]: Sample Questions 7 - 9 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 7

Edit

Write in Short

Short Answer▾

Can an abstract class may be final?

Explanation

  • No, abstract class may not be declared as final.
  • A final class is considered complete and cannot be sub classed.
  • Abstract classes require the implementation to provide definition to abstract methods in the subclasses.
  • Thus, a final class cannot have abstract methods and an abstract class cannot be declared final.

Question 8

Edit

Write in Short

Short Answer▾

In an “. htm” form I have a button that makes us to open another page in 15 seconds. How will you do that?

Explanation

  • On the on-click of the button create a thread and make it sleep for 5 second.
  • Then the action (jsp) file will be called.

Question 9

Edit

Describe in Detail

Essay▾

What are swing component?

Explanation

Diagram of Swing Component
  • A component is an independent visual control.
  • Swing Framework contains a large set of components allowing large customization.
  • They are all objects derived from Component class.
  • All components are lightweight components.
  • Below functions of component classes are widely used:
    • public void add (component c)

      Add a component on another component.

    • Public void setSize (int width, int height)

      Sets size of the component.

    • Public void setLayout (layout manager m)

      Sets the layout manager for the component.

    • Public void setVisible (boolean b) :
      • Sets the visibility of the component.
      • It is default false.

Developed by: