My Report

Java Programming Practice Test 8


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What is a listener in context to event handling?

2. What will be the output of the following Java 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).

3. Which of these packages contains all the classes and methods required for even handling in Java?

4. Which of these method of Locale class can be used to obtain country of operation?

5. Which of these keywords is used to define packages in Java?

6. Which of these is used to perform all input & output operations in Java?

7. Which of these methods is defined in MouseMotionAdapter class?

8. Which of these methods can be used to output a string in an applet?

9. Which of these is a type of stream in Java?

10. Object of which class is used to compile regular expression?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.