0

Currently I have the code that is below.

String[] ans = {"Yes","No"};
option = questionAsk("Are you sure?",ans);

I have tried simply sticking the definition of 'ans' into the call of the function and have tried to change it around but I cannot seem to find how to make these two lines become one.

1 Answer 1

13

You can define an array when calling a method:

option = questionAsk("Are you sure?", new String[]{"Yes","No"});

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! This is pretty much what I tried but left 'ans =' in the middle of the array definition! Thanks for your help!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.