Results 1 to 3 of 3
Thread: New to Java ...
- 05-13-2010, 09:57 PM #1
Member
- Join Date
- May 2010
- Location
- Pittsburgh, PA
- Posts
- 10
- Rep Power
- 0
New to Java ...
Ok I am new to this forum and am just starting out in Java... I have very little programming experinece at all.
I am taking a class in Java and need some help. I dont want anyone to do my homework for me but I am stuck I keep getting errors...
here is my code...
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package kelley1;
import java.awt.Rectangle;
/**
*
* @author Thomas P, Kelley
*/
public class RectangleTester {
public static void main (String[]args){
Rectangle myShape1 = new Rectangle();
double height = myShape1.getHeight();
double width = myShape1.getWidth();
System.out.Println("height:= "myShape1.getHeight);
System.out.println("width:= "myShape1.getWidth);
System.out.println("Area:" width * height);
}
}
- 05-13-2010, 10:12 PM #2
orJava Code:System.out.Println("height:= " + myShape1.getHeight()); System.out.println("width:= " + myShape1.getWidth()); System.out.println("Area:" + (width * height));
but you're not going to get anywhere, since you don't have a width or height value setJava Code:System.out.Println("height:= "+ height); System.out.println("width:= " + width); System.out.println("Area:" + (width * height));:rolleyes: ~ Sno ~ :rolleyes:
'-~ B.S. Computer Science ~-'
- 05-13-2010, 10:21 PM #3
Member
- Join Date
- May 2010
- Location
- Pittsburgh, PA
- Posts
- 10
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks