Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

katherine alvarez-escobar
katherine alvarez-escobar
1,316 Points

I need help with my java code

My assignment is to make a main method for three methods, this is the first one. Nothing pops up after i run it and i need help with figuring out what is missing.

code:

public class Main {

public static void main(String[] args) {

}
    public static double getArea(int length, int width) 
       { 
          return length * width; 

}

}

Steven Parker
Steven Parker
231,184 Points

It's not clear what course and lesson you are referring to. You might want to take a look at this video about Posting a Question. And when posting code, use Markdown formatting to preserve the code's appearance.

Andrew Stevens
Andrew Stevens
11,083 Points

A return statement will not print anything to the console, it will return the value from the method. If you want to display it you would need to instantiate the object and call the getArea() method in a System.out.print statement.