Published
- 1 min read
How to read Javadocs
Reading Javadocs can be daunting at first, but when you know what to look for, it’s actually super easy!
Let’s first start off by listing of the home page of a Javadoc site. For our example, we’re going to use SpigotMC’s Spigot API Javadoc.
As we can see, we get a view of all the packages that code is stored in, and an overview of the project itself. This is good and all, but we don’t want to search around for things, instead we can use the above search bar (on the right) we can look for something we want to modify. For our use case, let’s look at an ItemStack.
Now this is what we’re talking about. In this page we can see all the methods of ItemStack that could be useful to us.
For Example, we can now see that in ItemStack has methods like getting the amount of it, or creating a duplicate of it!
You can click on other tabs and see how to construct item stacks as well!
Now that you know how to read javadocs, let’s get real and try it yourself. There is no better way of learning something then by doing.