I have an idea that to learn a language (i.e. Java)I need to try all methods from language’s API; i want to try to use methods from its API.
is this a good idea? there are 10 000 methods in Java API. is this a good way to learn all language capabilities?
1
Java has a very rich library that comes with the language. It is rather impractical to attempt to learn all of the API (and then you start getting into the frameworks that aren’t default for the language – Spring (ghads)). You’ll be reading methods and classes from now until the next release of Java (and then you’ll be reading the change lists).
What is useful is to know what type of things are in the main packages and what they do.
The ones you will want to be familiar with are:
- java.lang – these are the ‘core’ ones that you’ll likely be encountering on a fairly frequent basis.
- java.util – ones you’ll often find yourself using.
- java.util.Collection and its implementing classes – you’ll find yourself using these time and time again.
Cases can certainly be made for additional packages of interest, though they start to get to specific domains of Java programming. The swing and awt packages are for gui programming, while the servlet package is something that web programmers tend to deal with (who never even glance at awt or swing – and vice versa).
The key is not to know everything in the language, but to know how to find anything in the language. The later is something that is an attainable goal and will continue to serve you well as the versions change.