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

Edit

Write in Short

Short Answer▾

Why wrapper classes?

Explanation

  • They convert primitive data types into objects.
  • Objects are needed to modify the arguments passed into a method- classes in java. util package handle only objects and hence wrapper classes.
  • Data structures in the Collection framework, such as ArrayList and Vector, store only objects and not primitive types.
  • An object is needed to support synchronization in multithreading.

Question 39

Edit

Describe in Detail

Essay▾

What is statement in java?

Explanation

  • “Statement” provides methods to execute queries on the the database.
  • Statement interface is a factory of ResultSet.
  • Provides factory method to get the object of ResultSet.

Methods of Statement interface:

  1. Public ResultSet executeQuery
    • Used to execute SELECT query.
    • Return the object of ResultSet
    • Public int executeUpdate
    • Used to excute specified query.
    • It create, drop, insert, update, delete.

      Used to execute batch of commands.

  2. Public boolean execute
    • Used to execute queries that may return multiple results.
    • Public int [] executeBatch
Methods of Statement Interface

Question 40

Edit

Describe in Detail

Essay▾

What are normalization Rules? Define Normalization?

Explanation

Understanding the Process of Normalization
  • Normalization is process of organizing data in a database.
  • It organizes tables to reduce redundancy and dependency.
  • Redundant data wastes disk space and creates maintenance problems.
  • Data that exist in more than one place must be changed in same way in all locations.
  • For example, a customer address change is much easier to implement if that data is stored only in the customers table and nowhere else in the database.

Rules of database Normalization:

  • There are a few rules for database normalization.
  • Each rule is called a “normal form” .
  • If the first rule is observed, the database is said to be in “first normal form.”
  • If the first three rules are observed, the database is considered to be in “third normal form.”
  • Among the levels of normalization, third normal form is the highest level necessary for most applications.

Developed by: