java - Return random boolean and use to guide an "if" statement -
I'm researching how to return a random boolean and then "if" to make the statement "if" i understand Can not come out how to use the structure or the sentence structure.
Private random random; Public zero mousePressed (MouseEvent e) {fixed Hit (); If (random = true) {// display correctly //} and {// display false} // private boolean fixed hat () {random.nextBoolean (); } How can I get my method of returning to boolean and then plug it back into the main body of that method?
Thanks
private random random; Public Zero Mouse Mouse Pressed (MouseWave E) {Boolean Hit: Results = Fixed Hate (); If (hitResult) {// actual display //} else {// display false} // private boolean fixed hit () {random.nextBoolean (); } Since a if () requires a Boolean result, then the == true lies in it, obviously Code is not required Just make sure that you have done the random in the constructor for an example before using it.
Comments
Post a Comment