What is printed after the following java statement? *Java?

System.out.println( 1 + 1/2 + 1/3 + 1/4 );

3 Answers

Relevance
  • roger
    Lv 7
    4 years ago

    1+0+0+0

    1

  • John
    Lv 5
    4 years ago

    Same as the other Output:"Drop this class"

    If you cant compile code you SHOULDNT be in the class.

    (1/2 + 1/3 + 1/4) = 0 +1 =1

  • joe
    Lv 6
    4 years ago

    What can t you compile it and see the result?

    If you can t do that, then do the simple math!

    Hint: use a calculator. If that is too complicated for you, then give up and fail the class!

Still have questions? Get answers by asking now.