Author Question: Can someone help me with this Java question? (Read 981 times)

natalie2426

  • Hero Member
  • *****
  • Posts: 524
I recently started my high school AP Computer Science. One of our homework assignments is: "Give the Java code for an object of class Rectangle and for an object variable of class Rectangle". I know how to use the Rectangle class and I know about objects but I'm confused about what the question is asking. Is it asking for the constructor of a Rectangle or something else. I'm especially confused by what they mean by object variable.



abarnes

  • Hero Member
  • *****
  • Posts: 556
I think they are asking for a class and just a variable declaration:

public class Rectangle {  ... }

vs.

Rectangle myRect;



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

Today, nearly 8 out of 10 pregnant women living with HIV (about 1.1 million), receive antiretrovirals.

Did you know?

For pediatric patients, intravenous fluids are the most commonly cited products involved in medication errors that are reported to the USP.

Did you know?

Allergies play a major part in the health of children. The most prevalent childhood allergies are milk, egg, soy, wheat, peanuts, tree nuts, and seafood.

Did you know?

The tallest man ever known was Robert Wadlow, an American, who reached the height of 8 feet 11 inches. He died at age 26 years from an infection caused by the immense weight of his body (491 pounds) and the stress on his leg bones and muscles.

Did you know?

It is widely believed that giving a daily oral dose of aspirin to heart attack patients improves their chances of survival because the aspirin blocks the formation of new blood clots.

For a complete list of videos, visit our video library