util package
1. Define package?
Ans:
package is a collection of group of similar types of classes , interfaces and sub
packages.
Ans:
1) package use to search .class file very faster.
2) It is use to categorise classes & interfaces so that they can be easily
maintained.
3) package use to remove naming collision.
Ans:
package categorized into 2 types
1. Built-in package
Built-in package-If the package already design & stored in the predefined
class then it is known as Built –in package.
2. user-defined package.
User-defined package-User-defined classes are the collection of user
definedclasses.
Ans:
1. package provides access protection.
2. package removes naming collision.
Ans:
There are 3 ways to access the package from another package
1. import package.*;
2. import package . class name.
3. fully qualified name.
Ans:
The import keyword used to make the classes and interfaces of another package
accessible to the current package.
Ans:
Lang is the default package in java.
Ans:
The package keyword is used to create a package.
Ans:
We need to use fully qualified name every time when accessing the classes and
interfaces.
Ans:
Socket & Server socket class present in net package and its operation mainly for
networking purpose.
Ans:
Input/Output classes present in io package.
Ans:
There are 2 ways to load class file
1. Temporary
a) by setting the class path in the command prompt.
b) by class path switch.
2. Permanent
a) by setting the class path in the environment variable.
b) by creating the jar file.
Ans:
Document API can create in java by the help of javadoc tool.
Ans:
JVM execute the .class file.
Ans:
java.lang.* is used for language functionalities.
Ans:
java.io.* is used for file handling application.
Ans:
java.awt.* is used for GUI components.
Ans:
java.applet.* is used for browser oriented application.
Ans:
java.net.* is used for client server application.
22. Which package is used for developing quality or reliable application in java?
Ans:
java.util.* is used for quality or reliable application in java.
23. Which package is used for formatting data and time on day to day business
operation?
Ans:
java.text.* is used for formatting data and time on day to day business
operation.
Ans:
This package is used for providing the functionality of GUI components.
Ans:
java.util.* is also known as collection framework in java.
26. Which package is used for runtime information about the class and interface?
Ans:
java.lang.reflect.* is used for study run time information about the class and
interface.
27. Which package is used for retrieving data from database & performing various
operation on database?
Ans:
java.sql.* is used for retrieving data from db & performing various operation on
db.