Text Formatting

1

What is the output of this program?

    import java.text.*;
    import java.util.*;
    class Date_formatting {	 
        public static void main(String args[]) {
	    Date date = new Date();
	    SimpleDateFormat sdf;
            sdf = new SimpleDateFormat("z");
            System.out.print(sdf.format(date));
        }	
    }

Note : The program is executed at 3 hour 55 minutes and 4 sec on Monday, 15 July(24 hours time).

A. z
B. Jul
C. Mon
D. PDT

2

What is the output of this program?

    import java.text.*;
    import java.util.*;
    class Date_formatting {	 
        public static void main(String args[]) {
	    Date date = new Date();
	    SimpleDateFormat sdf;
            sdf = new SimpleDateFormat("E MMM dd yyyy");
            System.out.print(sdf.format(date));
        }	
    }

Note: The program is executed at 3 hour 55 minutes and 4 sec on Monday, 15 July(24 hours time).

A. Mon Jul 15 2013
B. Jul 15 2013
C. 55:03:04 Mon Jul 15 2013
D. 03:55:04 Jul 15 2013

3

What is the output of this program?

 
    import java.text.*;
    import java.util.*;
    class Date_formatting {	 
        public static void main(String args[]) {
	    Date date = new Date();
	    SimpleDateFormat sdf;
            sdf = new SimpleDateFormat("hh:mm:ss");
            System.out.print(sdf.format(date));
        }	
    }

Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).

A. 3:55:4
B. 3.55.4
C. 55:03:04
D. 03:55:04

4

What is the output of this program?

    import java.text.*;
    import java.util.*;
    class Date_formatting {	 
        public static void main(String args[]) {
	    Date date = new Date();
	    SimpleDateFormat sdf;
            sdf = new SimpleDateFormat("mm:hh:ss");
            System.out.print(sdf.format(date));
        }	
    }

Note : The program is executed at 3 hour 55 minutes and 4 sec (24 hours time).

A. 3:55:4
B. 3.55.4
C. 55:03:04
D. 03:55:04

5

Which of these formatting strings of SimpleDateFormat class is used to print 

week of the year?

A. w
B. W
C. s
D. S