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

Prostaglandins were first isolated from human semen in Sweden in the 1930s. They were so named because the researcher thought that they came from the prostate gland. In fact, prostaglandins exist and are synthesized in almost every cell of the body.

Did you know?

Inotropic therapy does not have a role in the treatment of most heart failure patients. These drugs can make patients feel and function better but usually do not lengthen the predicted length of their lives.

Did you know?

Patients who have undergone chemotherapy for the treatment of cancer often complain of a lack of mental focus; memory loss; and a general diminution in abilities such as multitasking, attention span, and general mental agility.

Did you know?

When taking monoamine oxidase inhibitors, people should avoid a variety of foods, which include alcoholic beverages, bean curd, broad (fava) bean pods, cheese, fish, ginseng, protein extracts, meat, sauerkraut, shrimp paste, soups, and yeast.

Did you know?

There can actually be a 25-hour time difference between certain locations in the world. The International Date Line passes between the islands of Samoa and American Samoa. It is not a straight line, but "zig-zags" around various island chains. Therefore, Samoa and nearby islands have one date, while American Samoa and nearby islands are one day behind. Daylight saving time is used in some islands, but not in others—further shifting the hours out of sync with natural time.

For a complete list of videos, visit our video library