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">

boolean can not be null . You can basically have two options: see

return your function to a boolean (note capital 'B'). Boolean is more than a primitive object, and it may also be null .

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.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -