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
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.
Answered by Prakash
2 +2
There are no AI answers yet. The ability to request AI answers is coming soon!

Related Questions