i am trying to code a toString() method which returns the string "Power: ON" if the power variable is equal to true and "Power: Off" if the power variable is equal to false (the power variable is the boolean type). However i dont know how to do this as the only example i found just prints the information stored in the variable (e.g. if variable x equals10 it prints "X=10"). any ideas of how i should do this?
Laidler 0 Junior Poster in Training
BestJewSinceJC 700 Posting Maven
Zibo 2 Light Poster
Laidler 0 Junior Poster in Training
BestJewSinceJC 700 Posting Maven
Laidler 0 Junior Poster in Training
BestJewSinceJC 700 Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.