Troubleshooting

Referencing this from a Static Context

I get a compiler error that says I'm attempting to reference this from a static context.

This compiler error results from an attempt to access an instance field or method from a static method. This commonly occurs when you try to reference instance members within the main method. Make sure you declare all fields and methods static that should be, and then use a class instance to access any others from static methods.

Abstract Methods Cannot Have a Body

I get a compiler error that says I have an abstract method with a body.

You cannot declare a body for a method, and this includes an empty body, { } . When you declare an abstract method, make sure you replace the curly braces for the ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.