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

HIV testing reach is still limited. An estimated 40% of people with HIV (more than 14 million) remain undiagnosed and do not know their infection status.

Did you know?

Over time, chronic hepatitis B virus and hepatitis C virus infections can progress to advanced liver disease, liver failure, and hepatocellular carcinoma. Unlike other forms, more than 80% of hepatitis C infections become chronic and lead to liver disease. When combined with hepatitis B, hepatitis C now accounts for 75% percent of all cases of liver disease around the world. Liver failure caused by hepatitis C is now leading cause of liver transplants in the United States.

Did you know?

Certain rare plants containing cyanide include apricot pits and a type of potato called cassava. Fortunately, only chronic or massive ingestion of any of these plants can lead to serious poisoning.

Did you know?

Individuals are never “cured” of addictions. Instead, they learn how to manage their disease to lead healthy, balanced lives.

Did you know?

More than 50% of American adults have oral herpes, which is commonly known as "cold sores" or "fever blisters." The herpes virus can be active on the skin surface without showing any signs or causing any symptoms.

For a complete list of videos, visit our video library