Hello to everyone,

I am new to this forum as I am new to Java.

I would like to know if anyone has come up with a method that helps in learning the huge collection of classes of the Java API.

I know that question is not easy to answer. I just wanted to know how others think about this subject.

Thanks a lot for all your answers!

The ONLY way is through extensive experience using them.
I doubt anyone knows every method and field in every class of even the core API and knows its correct usage.
And if such a person exists no doubt that knowledge is purely academic and he has no clue as to how to actually apply it to real world situations.

The ONLY way is through extensive experience using them.
I doubt anyone knows every method and field in every class of even the core API and knows its correct usage.
And if such a person exists no doubt that knowledge is purely academic and he has no clue as to how to actually apply it to real world situations.

100% agreed. Make sure you learn concepts such as inheritance, polymorphism, interfaces, etc first - otherwise many of the methods in the Java API will not make much sense. I recommend either taking a course on Java or getting a decent beginner's book.

The API is there for you to read it, not learn it by heart.

As long you know how to call methods with the right number and type of arguments and put the return value inside the right type, you are ok.

Of course that doesn't mean that for every single method you need to look at the API. With extensive use some of the methods you learn them. But If you want to do something different, you don't have to remember everything, just where to find the method that you want.

And I don't believe that anyone knows the entire API even if it is the core java. If such person existed, he wouldn't know nothing about programming, because he would have wasted all his time in learning methods by heart instead of using them.

I agree with the previous posters. Don't learn the API, learn to use the API JavaDoc and Google to find what you need when you need it. As you build up experience you'll get to know the most common APIs, and you'll be able to copy/paste from things you have already written and debugged for many more (so never throw away any working code you've written).

I agree with the previous posters. Don't learn the API, learn to use the API JavaDoc and Google to find what you need when you need it. As you build up experience you'll get to know the most common APIs, and you'll be able to copy/paste from things you have already written and debugged for many more (so never throw away any working code you've written).

Somewhat agreed on both points. Unless you are exceptionally good at organization, keeping every code you write is going to take longer as far as reusability than rewriting certain things will. But in general, holding on to modular code can't hurt. And unless you know a good bit of the API, it will be substantially harder to understand the other parts.

. Unless you are exceptionally good at organization, keeping every code you write is going to take longer as far as reusability than rewriting certain things will.

Yes, well, maybe every was a bit heavy!
I always think about whether code I'm about to write has any potential for re-use and, if it seems possible, I write it as a library class for reuse. Over the years I've accumulated a real treasure-chest of useful code which, even if it's not exactly what I need, can often be extended (and thus the extensions saved for future re-use).
I'm a major fan of code reuse.

I wonder what your (former) employers would have to say about you taking all the code you wrote for them and storing it for future use in other projects they're not getting paid for.

I wonder what your (former) employers would have to say about you taking all the code you wrote for them and storing it for future use in other projects they're not getting paid for.

Leaving aside the exact legal nicities for the moment, all I can say is that in the >40 years since I started earning my living as a programmer it's never once come up as a problem.
Obviously I woudn't be able to re-use proprietary or trade secret algorithms etc, but the kind of code I'm talking about is generic . I also have been maybe lucky in that all my employers (except, obviously, the very first) and contracts have been smart enough to see that they gain more than they lose in terms of my productivity.
On the other hand, I've never worked for a firm of copyright lawyers, fortunately.

Thank you all for taking the time to answer my question!

I believe you are all right. It's impossible to learn this API by heart.

I guess, given a certain project/task, a combination of Google Search
and the Java API docs is what it takes to become a good Java
programmer.

Thanks again for all your help!

I remember browsing through the API and finding a Robot class and it looked cool so I clicked on it and I was amazed that there was an object that let you control the mouse movement on the screen xD

So much crazy stuff to do with the API ^^

Absolute agreement is what i share with party who said one can not
actually know all the API Documentation by heart, to me it is provided for all
programmers just like the dictionaries/encyclopedias that are provided for all as reference books, so i think the best bet is to make use of it check for methods
one will be needing and i belief by so doing one will go a long way to learn a lot depending on how frequent coding is

Comments
Next time please check thread creation date and last reply time.
This question has already been answered. Start a new discussion instead.