How to declare a boolean and use a method JAVA help!?
-
Hi, I want to know how do i declare a field as a boolean type in the class and set it to "false" in the constructor... also, for a method, how would i change this value from 'true' to 'false' please help, im new to java..thank you in advance!
-
Answer:
class BooleanTest { boolean isActive; public BooleanTest() { isActive = false; } // this will flip a boolean like a light switch public void switch() { isActive = !isActive; } public void setBoolean( boolean b ) { isActive = b; }
Samantha at Yahoo! Answers Visit the source
Related Q & A:
- How To Send a Complex Object to a Rest Web Service?Best solution by codeproject.com
- How to get a specific data after post method?Best solution by Stack Overflow
- How cookies are handled if you use a proxy between a client and server in HTTP?Best solution by Stack Overflow
- How does the imagery in "to kill a mocking bird" help to reveal and explain the setting of the story?Best solution by Yahoo! Answers
- How to connect a psp go to a PS3 controller using a computer?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.