The statement System.out.printf("%10s", 123456) outputs ___________. (Note: * represents a space)

a. 123456****
b. 23456*****
c. 12345*****
d. ****123456


d %10s specifies to display a string with width 10 . By default, it is right justified. So, the correct answer is D.

Computer Science & Information Technology

You might also like to view...

____________________ are the lines that separate one cell from another.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Analyze the following code:

``` public class Test { public static void main(String[] args) { B b = new B(); b.m(5); System.out.println("i is " + b.i); } } class A { int i; public void m(int i) { this.i = i; } } class B extends A { public void m(String s) { } } ``` a. The program has a compile error, because m is overridden with a different signature in B. b. The program has a compile error, because b.m(5) cannot be invoked since the method m(int) is hidden in B. c. The program has a runtime error on b.i, because i is not accessible from b. d. The method m is not overridden in B. B inherits the method m from A and defines an overloaded method m in B.

Computer Science & Information Technology

Match the following prefixes to their meanings:

I. kilo II. mega III. peta IV. giga V. tera A. 1,000,000 B. 1,000 C. 1,000,000,000 D. 1,000,000,000,000,000 E. 1,000,000,000,000

Computer Science & Information Technology

The _____ is a credit card-sized device with an embedded microchip to provide electronic memory and processing capability.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology