java - Return keywords for a boolean statement -
I am writing an incredibly primitive blackjack game for high school programming class and playing with a boolean writing Public Boolean Dealer Tracker (if (a == 11 || one == 12 || one == 13) {a = 10;} Dealerhand value = A + Dealerhand value; If (DealerHold Value 21) {DealerHand.Set Text ("The House Was Busted !! !! Everyone Wins !!"); Back to True;} And If (DealerHand Value <21) {Return Null;} and if (dealer value value == 21) {return false;}}
I am getting an error saying that return tap (I Fancy blockcoat was not able to manage to work) is invalid. However, to work for this bullion, I really need three return statements, so my question is: is there any way to do zero work? , Or can I put it in its place, which is still appropriate I'm stupid here, or I'm stupid here. Please note that I do not really need this boolean, so if you think there is no solution, just recommend boolean removal . "post-text" itemprop = "text"> return your function to a A better solution would be to define an enum, this will help you to protect the meaning of return value, which will make your code more readable and easy to maintain. boolean can not be
null . You can basically have two options: see
boolean (note capital 'B').
Boolean is more than a primitive object, and it may also be
null .
Comments
Post a Comment