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