Results 1 to 2 of 2
Thread: methods
- 01-26-2012, 11:50 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
methods
can anyone help with code for this, totally confused.
This interface
should specify the following methods.
togglePower() – a public method that takes no argument and returns no result.
Its purpose is to switch the receiver 'on' (true) if it is currently 'off' (false) and if
the energy level of the receiver is greater than 0, and switch the receiver 'off'
(false) if it is currently 'on' (true).
chargeFor() – a public method that takes a single argument of type int called
numberMinutes and returns a value of type int as result. A charging operation
for the amount of time specified by the argument is attempted. The energy level of
the receiver is returned as the result.
cleanTo() – a public method that takes an int argument called aPosition and
returns a value of type boolean as result. A cleaning operation starting at the
current position of the receiver and finishing at the position given by the argument is
attempted. The method returns true if the receiver is able to complete the cleaning
operation, and false otherwise.
- 01-27-2012, 12:04 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,604
- Rep Power
- 5
Re: methods
What is confusing? Do you know what an interface is?
What Is an Interface? (The Java™ Tutorials > Learning the Java Language > Object-Oriented Programming Concepts)
Similar Threads
-
Trouble with static methods and boolean equals() methods with classes
By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04-16-2012, 11:00 PM -
Java Noob, trying to call methods from another methods
By gabrielpr12 in forum New To JavaReplies: 8Last Post: 11-17-2011, 09:07 PM -
difference between static methods and instantce methods?
By venkatch in forum New To JavaReplies: 1Last Post: 10-23-2011, 12:37 PM -
Incorporating If-Else into Methods + Private Helper Methods?
By 5minutes in forum New To JavaReplies: 1Last Post: 10-05-2011, 12:15 AM -
How to get methods to see variables in other methods
By ejs7597 in forum New To JavaReplies: 4Last Post: 04-03-2009, 06:36 AM


LinkBack URL
About LinkBacks

Bookmarks