Exam Permalink:
https://www.jobilize.com/java-certification-questions
Question Permalink:
https://www.jobilize.com/writing-java-printf-or-format-statement
Question 78 / 297:  Which of the following statements produces the output 3 + 8 ?
Choose 2
public class Tester {

public static void main(String[] args) {

int x = 8;

int y = 3;

System.out.printf("%d + %d \n", y, x); // stmt1

System.out.printf("%f + %f \n", (float) y, (float) x);// stmt2

System.out.printf("%d + %d \n", x, y);// stmt3

System.out.format("%2$d + %1$d", x, y);// stmt4

}

}

<< First < Previous Next > Last >>
Exam Home Page
https://www.jobilize.com/java-certification-questions

Oracle Certified Professional Java Programmer

Author:

Access: Public Instant Grading

Ask
Saylor Foundation
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>