menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Consider a method defined with the header: public static void doStuff(int x) Which of the following method calls is legal? 1. doStuff(0.1 + 0.2); 2. doStuff(9); 3. all of the options are legal except for
asked
Jun 3, 2018
88.3k
views
0
votes
Consider a method defined with the header:
public static void doStuff(int x)
Which of the following method calls is legal?
1. doStuff(0.1 + 0.2);
2. doStuff(9);
3. all of the options are legal except for one
4. doStuff(0.555);
5. doStuff(0.1, 0.2);
Computers and Technology
high-school
Kiratijuta
asked
by
Kiratijuta
7.5k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
4
votes
The floating point number will be demoted to an int, so 1 and 4 are fine. 2 is fine naturally, but 5 is invalid (2 params passed where 1 is expected).
Therefore option 3 is correct:
all of the options are legal except for 5
Rooni
answered
Jun 9, 2018
by
Rooni
6.4k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
8.0m
questions
10.6m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org