We have come to a point that i think you are ready to explore what Java is all about. You will often hear me say “RTFM”, i.e Read The Fine (??) Manual! In Java this is more feasible than any other language. The documentation is well structured and well written. Nothing is left out. To be exact every bit of code is documented for us to see how to use it. The full documentation API is availiable here. You can also download a local copy for your reference here. But let’s see how you can get all the info from the documentation…
Take a quick look at the image below:
There are three parts on the browser now…
- This is the part that shows all the available packages on the JDK (Java Development Kit). This is where you start off. Choose the package you want (Here i chose the java.lang).
- This is where you should look after you choose a package. Here all the classes are listed on the package, group by interfaces, classes and exceptions. Click the class you want (here i chose the String class).
- This is the final part. This is where all the info about this class are displayed. As you can see there are info about the class hierarchy, all known subclasses. If it was an interface you would see all known implementers.
Now, the documentation starts with general information about the class. What it does, any tips etc. Then if you scroll down you should see three (at most) tables, the field list, the constructor list and the method list. Take a look at the image below:
Now. Let’s take a quick look.
- This is the modified of the field. As you can see this field is static. It could also be final.
- This is the type of the field. This is a PrintStream.
- This is the name of the field.
- Now we are into the methods (whatever goes here same goes for the constructors except for the return type). This is the modifier of the method. It is static, it could also be abstract.
- This is the return type. This method returns void (absolutely nothing).
- This is the name of the method. This one is called arraycopy.
- Finally, these are the parameters of the method. Below that, you can see a short description of the method.
For each one you get a short description. To get a closer look click on a field, constructor or method and you will be taken to the detailed view. There, for methods especially, you can see if it throws any exception, what is everything it returns etc. Take a peak.
You need to be very comfortable about the documentation because it is the most crucial knowledge on Java, to know where to find information about a class you need to use. On a next tutorial we will see how we can easily create our own javadocs on our code. Just a small hint. They are automatically generated! No need for HTML or anything. Just a small tool 😉
once again nice post 🙂
Is there any method to read the contents of an webpage and load it into Microsoft Excel file??
@siddharth: thx man…
@shitu: please clarify what you mean. do you mean have any htm or html file opened by excel of anything else?
Check data here
http://www.uptu.ac.in/exam_even_2008/bt06_showResult.asp?rollno=0506310010
I want to collect this data and save it in an Microsoft Excel.
Can we do it in Java??
I know how to read data from excel file to java program!!
we certainly can do that but i would not suggest it. i would strongly suggest perl for this kind of work. what needs to be done is get the text, parse it and save the values… let me know which part you need help with 🙂