Is there a way to get this down to one line of code?
boolean [] myArrary = {true, false};
return myArrary;
I'm trying to combine those lines into one, but I am not sure what the correct syntax would be.
Thanks, sj
Is there a way to get this down to one line of code?
boolean [] myArrary = {true, false};
return myArrary;
I'm trying to combine those lines into one, but I am not sure what the correct syntax would be.
Thanks, sj
Care to elaborate.
the syntax you're looking for is:
return new boolean[] {true, false};
ahh thanks. I didn't have the "new" keyword
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.