Java interview questions part 11

Java interview questions part 11

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Which of these events will be notified if scroll bar is manipulated?

Correct Answer is : AdjustmentEvent

2. Which of these events will be generated if we close an applet’s window?

Correct Answer is : WindowEvent

3. Which of the following is not a class of java.util.regex?

Correct Answer is : Regex class

4. What is the significance of Matcher class for regular expression in java?

Correct Answer is : interpreted both pattern and performs match operations in the string

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

Correct Answer is : Pattern class

6. Which capturing group can represent the entire expression?

Correct Answer is : group 0

7. groupCount reports a total number of Capturing groups.

Correct Answer is : TRUE

8. Which of the following matches nonword character using regular expression in java?

Correct Answer is : \W

9. Which of the following matches end of the string using regular expression in java?

Correct Answer is : \z

10. What does public int end(int group) return?

Correct Answer is : offset from last character of the subsequent group

11. what does public String replaceAll(string replace) do?

Correct Answer is : Replace every subsequence of the input sequence that matches pattern with a replacement string

12. What does public int start() return?

Correct Answer is : returns start index of the previous match

13. Which of the following keywords is used for throwing exception manually?

Correct Answer is : throw

14. Which of the following classes can catch all exceptions which cannot be caught?

Correct Answer is : Error

15. Which of the following is a super class of all exception type classes?

Correct Answer is : Throwable

16. Which of the following operators is used to generate instance of an exception which can be thrown using throw?

Correct Answer is : new

17. Which of the following keyword is used by calling function to handle exception thrown by called function?

Correct Answer is : throws

18. Which of the following handles the exception when a catch is not used?

Correct Answer is : default handler

19. Which part of code gets executed whether exception is caught or not?

Correct Answer is : finally

20. Which of the following should be true of the object thrown by a thrown statement?

Correct Answer is : Should be assignable to Throwable type

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon