Choose the correct result of compiling and running following code:

import java.util.Formatter;
public class Format2 {
  public static void main(String[] args) {
    String s = "hello123";
    Formatter f = new Formatter();
    f.format("%S", s);
    System.out.println(f);
  }
}
Explanation
Given a String, '%S' converts it to upper case. http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes