Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > 2+2 Communities > Other Other Topics
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-08-2005, 11:26 PM
Shilly Shilly is offline
Senior Member
 
Join Date: Aug 2004
Location: Madison, WI
Posts: 128
Default Java Help Needed

I'm in an Intro to Programming course that uses Java. For my Codelab assignments (little exercises online where you write a few lines of code, and they tell you if it is correct or not), I'm struggling with object creation. I'll list the instructions here:

Suppose there is a class AirConditioner . The class supports the following behaviors: turning the air conditioner on, off, and setting the desired temperature. The following methods are provided for these behaviors: turnOn and turnOff , which accept no arguments and return no value, and setTemp , which accepts an int argument and returns no value.

There is a reference variable officeAC of type AirConditioner . Create a new object of type AirConditioner using the officeAC reference variable. After that, turn the air conditioner on using the reference to the new object, and set the desired temperature to 69 degrees.


I know this will seem incredibly easy to someone with Java experience, but I'm having a mental block. I can't find anyting about it in this garbled textbook, and Codelab's suggestions are unhelpful.

Thanks in advance.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.