Question 1 of 25
Hints left: 3
Q1
What does public int start() return?
Q2
What is the purpose of the `reset()` method in Java regular expressions?
Q3
In a regular expression, what does the metacharacter `G` represent?
Q4
Which of the following matches end of the string using regular expression in java?
Q5
What is an event in Java?
Q6
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).
Q7
Which of the following matches nonword character using regular expression in java?
Q8
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("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).
Q9
Which of this class can be used to format dates and times?
Q10
Which of the following is not a class of java.util.regex?
Q11
What does public int end(int group) return?
Q12
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("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).
Q13
In a regular expression, what does the metacharacter `A` represent?
Q14
what does public String replaceAll(string replace) do?
Q15
Which of these class allows us to define our own formatting pattern for dates and time?
Q16
Object of which class is used to compile regular expression?
Q17
What is the significance of Matcher class for regular expression in java?
Q18
Which capturing group can represent the entire expression?
Q19
Which of these package is used for text formatting in Java programming language?
Q20
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("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).
Q21
Which of these formatting strings of SimpleDateFormat class is used to print AM or PM in time?
Q22
Which of these formatting strings of SimpleDateFormat class is used to print week of the year?
Q23
Which of these method returns an instance of DateFormat that can format time information?
Q24
groupCount reports a total number of Capturing groups.
Q25
In Java event handling, what is an event source?