Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
Which of the following expressions produce a value of type int?Asked by Emuye
Which of the following expressions produce a value of type int?
Answers
Answered by
Emuye
2 + 2
Integer.parseInt("2")
2 + 2.0
7 / 3
11 * (int) 0.25
Integer.parseInt("2")
2 + 2.0
7 / 3
11 * (int) 0.25
Answered by
oobleck
well, clearly 2+2 and parseint() and casting as (int) do the job
also 7/3, since java does integer division
the java documentation is very complete. You would do well do read it and refer to it often.
also 7/3, since java does integer division
the java documentation is very complete. You would do well do read it and refer to it often.
Answered by
Prakash
2 +2
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.