Author Question: Can someone help me with this Java question? (Read 978 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?

To combat osteoporosis, changes in lifestyle and diet are recommended. At-risk patients should include 1,200 to 1,500 mg of calcium daily either via dietary means or with supplements.

Did you know?

The liver is the only organ that has the ability to regenerate itself after certain types of damage. As much as 25% of the liver can be removed, and it will still regenerate back to its original shape and size. However, the liver cannot regenerate after severe damage caused by alcohol.

Did you know?

Carbamazepine can interfere with the results of home pregnancy tests. If you are taking carbamazepine, do not try to test for pregnancy at home.

Did you know?

Multiple sclerosis is a condition wherein the body's nervous system is weakened by an autoimmune reaction that attacks the myelin sheaths of neurons.

Did you know?

The highest suicide rate in the United States is among people ages 65 years and older. Almost 15% of people in this age group commit suicide every year.

For a complete list of videos, visit our video library