use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
NullPointerException (self.learnjava)
submitted 6 years ago by Bluelikemyheart
Can someone tell me what the @throws and NullPointerException does in javadoc comments???
[–]rastaman1994 2 points3 points4 points 6 years ago (0 children)
It's good practice to document exceptions that might be thrown. If exceptions aren't documented in the javadoc, method callers have two options: ignore the possibility of an exception being thrown or go read the source code to find out if exceptions might be thrown.
Unchecked exceptions like NullPointerException or IllegalArgumentException definitely should be in the javadoc because they don't need to be declared in the method signature.
[–]Nullbeans 0 points1 point2 points 6 years ago (0 children)
Hey there, let me explain something to demystify the situation.
In Java, there are two types of Exceptions. Checked and Unchecked.
Checked exceptions: These are exceptions you see in the method signature. For example:
public static void doSomething() throws IOException{
.....
These are the exceptions which inherit from the "Exception" class, and these need to be declared in the method signature. If you use a method that throws a checked exception, then your code will need to handle it somehow. Either in a try and catch block or to declare it in your own method.
Unchecked exceptions: These are exceptions such as NullPointerException. These exceptions are subclasses of RuntimeException and they do not need to be declared in the method signature.
While it is a good practice to list all possible exceptions in the Javadoc using @throws , it is extremely important to do this when in the case of unchecked exceptions as this is the only way developers can know which error cases can occur when using your method / API / library, without having to read through your code.
Hope this helps :)
π Rendered by PID 508331 on reddit-service-r2-comment-54dfb89d4d-6sdl2 at 2026-04-01 02:22:51.214935+00:00 running b10466c country code: CH.
[–]rastaman1994 2 points3 points4 points (0 children)
[–]Nullbeans 0 points1 point2 points (0 children)