Question:
how do i view packages in java?
2013-08-15 00:14:38 UTC
is there any command in cmd so that i can view all the predefined packages in java and also i want to view what are all the available methods in those packages.
Three answers:
AnalProgrammer
2013-08-15 01:28:17 UTC
Here is a link to the Java documentation.

It would help you to learn how to use it.



Click on lang and util in the top left of the yellow block.

Click on java.lang in the package list.

This is a list of classes in the basic lang package.

Click on Frames link at the top.

The second box on the left is a list of all classes that are available in all packages in Java. Scroll down to find your class. Click on it to see what package it is in. You will also have all methods for that class.



Have fun.
?
2013-08-15 00:53:46 UTC
A Java package is a mechanism for organizing Java classes into namespaces similar to the modules of Modula. Java packages can be stored in compressed files called JAR files, allowing classes to download faster as a group rather than one at a time. Programmers also typically use packages to organize classes belonging to the same category or providing similar functionality.

A package provides a unique namespace for the types it contains.

Classes in the same package can access each other's package-access members.

In general, a package can contain the following kinds of types. A package allows a developer to group classes (and interfaces) together. These classes will all be related in some way – they might all have to do with a specific application or perform a specific set of tasks. The Java API is a collection of packages – for example, the javax.xml package. The javax.xml package and its subpackages contain classes to handle XML.
Rudra Pratap
2013-08-16 03:11:24 UTC
If you want a list of packages in the standard installation, just go to the Javadocs and look in the upper left corner.

If you want to see the .class files, they're in lib\rt.jar in the JRE directory (.jar is the same as .zip, so you can open it with anything that can open zip files).

If you want to see the source code, look in src.zip in the JDK directory. If it's not there, you probably elected not to install it when you installed the JDK.

Keep in mind that packages are represented as folders on disk, so you might be a little disappointed by what you see.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...