Menu
Topics Index
...
`

Programmable logic controller


If you need explanation Read this topic

If you need Answer Take test on this topic

Programmable logic controller
What will be the output of the following program?
import java.util.*;
public class Computer {
    public static void main(String[] args) {
        int pLC = 12;
        Formatter f = new Formatter();
        f.format("%o ", pLC);
        f.format("%x", pLC);
        System.out.println(f);
    }
}

A. 12 C
B. 14 c
C. Compilation Error
D. Runtime Error
Topic: Java Formatting Numbers

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans B %o gives octal value which is 14 and %x gives hexadecimal value which is in lower case why because x is in lower case

Posted by Bheema Reddy    2014-03-13 03:59:07


Congratulations Bheema Reddy. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-03-14 04:10:58


© meritcampus 2019

All Rights Reserved.

Open In App