Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error message "missing method body, or declare abstract"

843789Aug 7 2010 — edited Aug 7 2010
This is my test driver. Does anyone know why it is not working?
public class TestInfo 
{
 
   public static void main(String args[])
	{
		Info results = new Info();
		printInfo();
   }
	
	public static String printInfo();
	{
		System.out.println(" The Diameter is: " + results.diam 
		+ " The Circumference is: " + results.circum
		+ " The Area is: " + results.area);
	}
}
The error message I get is: missing method body, or declare abstract

The print block has to be a separate method. The print block works when I put it in main. When it is in a separate method and I call it in main it doesn't work
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2010
Added on Aug 7 2010
1 comment
1,067 views