Regular Expressions In Java — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Regular Expressions In Java — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
7
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
9 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
7
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress | 0/7 answered
✓ 0 correct
✗ 0 wrong
0% score
🎉 Set complete! All 7 questions answered.
Question 1 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Question 2 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these formatting strings of SimpleDateFormat class is used to print week of the year?
Question 3 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following matches nonword character using regular expression in java?
Question 4 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
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).
Question 5 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these method returns an instance of DateFormat that can format time information?
Question 6 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
what does public String replaceAll(string replace) do?
Question 7 of 7
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Object of which class is used to compile regular expression?
✓ Link copied to clipboard
Continue Your Practice
Next Practice Set → Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡 Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.