Search:

Type: Posts; User: rayp4993

Search: Search took 0.07 seconds.

  1. Replies
    8
    Views
    1,465

    Re: Need help with classes and constructors!!

    Thank you for all your help tonight I really appreciate it!
  2. Replies
    8
    Views
    1,465

    Re: Need help with classes and constructors!!

    I ended up revising my code and decided to go with




    class Square {

    public double side;
    public double area;
    public double perim;
  3. Replies
    8
    Views
    1,465

    Re: Need help with classes and constructors!!

    But I already have an instance of Square which is sq right? So it should work if I do sq.getArea(); All I need to do is display the calculation made in getArea...
  4. Replies
    8
    Views
    1,465

    Re: Need help with classes and constructors!!

    Thanks, what you are sayin seems right but I just cant grasp it. I made
    public double getArea(double a){

    area = a * a;
    return area;
    }
    inside class Square, but how can I run that from...
  5. Replies
    8
    Views
    1,465

    Need help with classes and constructors!!

    Hello everyone, I am new to java and method calls from outside a class is still a little confusing to me, What I am trying to do is take a square object defined in one class and calculate the area...
Results 1 to 5 of 5