question archive Can a boolean variable equate itself? For example, if booleanVariable has been initialized as True, and we have a booleanMethod() checking whether something evaluates to true/false; would the second underlined statement be doing a comparison between the booleanVariable and the booleanMethod result and saving said result in booleanVariable? If so, why not just equate booleanVariable to the booleanMethod() itself? Example code: boolean booleanVariable = True; //initializing booleanVariable booleanVariable = booleanVariable && booleanMethod();

Can a boolean variable equate itself? For example, if booleanVariable has been initialized as True, and we have a booleanMethod() checking whether something evaluates to true/false; would the second underlined statement be doing a comparison between the booleanVariable and the booleanMethod result and saving said result in booleanVariable? If so, why not just equate booleanVariable to the booleanMethod() itself? Example code: boolean booleanVariable = True; //initializing booleanVariable booleanVariable = booleanVariable && booleanMethod();

Subject:Computer SciencePrice:4.86 Bought7

Can a boolean variable equate itself?

For example, if booleanVariable has been initialized as True, and we have a booleanMethod() checking whether something evaluates to true/false; would the second underlined statement be doing a comparison between the booleanVariable and the booleanMethod result and saving said result in booleanVariable? If so, why not just equate booleanVariable to the booleanMethod() itself?

Example code:

boolean booleanVariable = True; //initializing booleanVariable

booleanVariable = booleanVariable && booleanMethod();

Option 1

Low Cost Option
Download this past answer in few clicks

4.86 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 7 times

Completion Status 100%