Languages-Java [3i Infotech Placement]: Sample Questions 25 - 27 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 25

Edit

Describe in Detail

Essay▾

What is the difference between AWT and swing?

Explanation

Difference between AWT and Swing
AWTSwing
Abstract window toolkitAlso called Java Foundation Classes.
Components are heavyweight.Lightweight components.
Require java. awt package.Require javax. swing package.
Components are platform dependent.Made in purely java and they are platform independent.
Occupies more memory space.Occupies less memory space.
Less powerful than swing.Extension to AWT and many drawbacks of AWT are removed in swing.

Question 26

Edit

Write in Short

Short Answer▾

What is the main functionality of prepared statement?

Explanation

  • Prepare is used to send SQL queries.
  • Prepares stores the query in in system global area memory.
  • For same query sent a second time no compilation is done to improve performance.
  • Thus first time it is not precompiled but for the second time it is precompiled.
  • It is wrong assumption that prepared statement is precompiled statement.
  • Prepared statement have faster execution than other statements.

Question 27

Edit

Write in Short

Short Answer▾

What restrictions are placed on method overloading?

Explanation

Restriction imposed on Method Overloading are

a) should done within the same class.

b) Should have same name of overloading method.

c) Arguments or parameter should be different irrespective of return type.

Developed by: