Anda di halaman 1dari 4

Question related to java.

util package

1. Define package?

Ans:
package is a collection of group of similar types of classes , interfaces and sub
packages.

2. State the use of package?

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.

3. Describe types of package & Describe them?

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.

4. What are the advantages of package?

Ans:
1. package provides access protection.
2. package removes naming collision.

5. How to access package from another package?

Ans:
There are 3 ways to access the package from another package
1. import package.*;
2. import package . class name.
3. fully qualified name.

6. State the use of import keyword?

Ans:
The import keyword used to make the classes and interfaces of another package
accessible to the current package.

7. How much pre-defined package java supports?


Ans:
80,000 classes present in 202 no of packages.

8. Who is the default package in java?

Ans:
Lang is the default package in java.

9. State the use of package keyword?

Ans:
The package keyword is used to create a package.

10. When to use fully qualified name?

Ans:
We need to use fully qualified name every time when accessing the classes and
interfaces.

11. State the operation & package of Socket& ServerSocket classes?

Ans:
Socket & Server socket class present in net package and its operation mainly for
networking purpose.

12. Input/Output classes present in which package?

Ans:
Input/Output classes present in io package.

13. What are the ways to load class file?

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.

14. How to create document API in java?

Ans:
Document API can create in java by the help of javadoc tool.

15. State the condition where fully qualified name in compulsory?


Ans:
Fully qualified name is compulsory when accessing the classes and interfaces.

16. How to execute .class file?

Ans:
JVM execute the .class file.

17. Which package is used for achieving the language Functionalities?

Ans:
java.lang.* is used for language functionalities.

18. Which package is used for developing file handling application?

Ans:
java.io.* is used for file handling application.

19. Which package is used for developing GUI components?

Ans:
java.awt.* is used for GUI components.

20. Which package is used for developing browser oriented application?

Ans:
java.applet.* is used for browser oriented application.

21. Which package is used for developing client server 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.

24. State the use of Event package?

Ans:
This package is used for providing the functionality of GUI components.

25. Which package is also known as collection framework in java?

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.