Click here to Skip to main content
15,891,708 members
Home / Discussions / Java
   

Java

 
GeneralRe: structure equivalant in java Pin
Nagy Vilmos6-Oct-10 2:08
professionalNagy Vilmos6-Oct-10 2:08 
GeneralRe: structure equivalant in java Pin
David Skelly6-Oct-10 4:25
David Skelly6-Oct-10 4:25 
GeneralRe: structure equivalant in java Pin
trioum6-Oct-10 4:58
trioum6-Oct-10 4:58 
GeneralRe: structure equivalant in java Pin
trioum6-Oct-10 6:22
trioum6-Oct-10 6:22 
GeneralRe: structure equivalant in java Pin
David Skelly6-Oct-10 6:59
David Skelly6-Oct-10 6:59 
GeneralRe: structure equivalant in java Pin
trioum6-Oct-10 22:34
trioum6-Oct-10 22:34 
QuestionRe: structure equivalant in java Pin
David Crow7-Oct-10 10:00
David Crow7-Oct-10 10:00 
QuestionAlarm Clock Help Pin
Autunmsky224-Oct-10 17:32
Autunmsky224-Oct-10 17:32 
I'm having a problem writing the switch part for my alarm clock...I'm just not sure how to write the code. Thank you for all of you help Smile | :)


• The alarm clock can be constructed using the classes in the clock example, namely ClockDisplay and NumberDisplay. Just as a ClockDisplay object can be considered as two NumberDisplay objects, An AlarmClock object can be considered a ClockDisplay object

• an alarm that can be set to go off at a particular time. The alarm has a switch that allows it to be set for the alarm to go off at the appropriate time. If the switch is not set the alarm does not ring at the appropriate time.

• Note that the ClockDisplay class only returns the time as a String, so you will need to make a comparison of two String objects to determine when to ring the alarm. The == operator is not a valid way to do this. It does not compare Strings the way we would expect. But the String class contains a method that is appropriate. Its signature is
boolean equals (String)
This method returns true when the string executing the method is equal to (has exactly that same characters in the same order) the string that is passed as a parameter, and false otherwise. For example
"hello".equals("hello") returns true
"hello".equals("goodbye") returns false

• It is also possible to build the alarm from other classes. Consider the characteristics:
o it contains a time that the alarm is set to
o that time can be changed
o it contains a switch to turn the alarm setting on or off.
AnswerRe: Alarm Clock Help Pin
Richard MacCutchan4-Oct-10 22:09
mveRichard MacCutchan4-Oct-10 22:09 
AnswerRe: Alarm Clock Help Pin
TorstenH.5-Oct-10 3:08
TorstenH.5-Oct-10 3:08 
Questionkey word 'this' Pin
Tichaona J1-Oct-10 5:32
Tichaona J1-Oct-10 5:32 
AnswerRe: key word 'this' Pin
Nagy Vilmos1-Oct-10 5:41
professionalNagy Vilmos1-Oct-10 5:41 
GeneralRe: key word 'this' Pin
Luc Pattyn2-Oct-10 14:28
sitebuilderLuc Pattyn2-Oct-10 14:28 
AnswerRe: key word 'this' Pin
Neo101011-Oct-10 12:45
Neo101011-Oct-10 12:45 
AnswerRe: key word 'this' Pin
Dave Doknjas2-Oct-10 13:31
Dave Doknjas2-Oct-10 13:31 
AnswerRe: key word 'this' Pin
jwintermute5-Oct-10 5:11
jwintermute5-Oct-10 5:11 
AnswerRe: key word 'this' Pin
RaviRanjanKr8-Nov-10 17:51
professionalRaviRanjanKr8-Nov-10 17:51 
Questionprinting jtextpane silently Pin
ndiga29-Sep-10 22:58
ndiga29-Sep-10 22:58 
AnswerRe: printing jtextpane silently Pin
TorstenH.5-Oct-10 3:13
TorstenH.5-Oct-10 3:13 
Questionprinting multiple items on the same paper Pin
ndiga29-Sep-10 22:56
ndiga29-Sep-10 22:56 
Question"missing return statement" error [Solved] Pin
Skippums29-Sep-10 8:33
Skippums29-Sep-10 8:33 
AnswerRe: "missing return statement" error Pin
Skippums29-Sep-10 9:25
Skippums29-Sep-10 9:25 
AnswerRe: "missing return statement" error Pin
Luc Pattyn29-Sep-10 10:06
sitebuilderLuc Pattyn29-Sep-10 10:06 
QuestionXml beans problem Pin
Stephen Lintott29-Sep-10 5:10
Stephen Lintott29-Sep-10 5:10 
QuestionImmutability compromised if 'final' is omitted? Pin
Neo1010127-Sep-10 7:50
Neo1010127-Sep-10 7:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.