OOJ-CIE 3 Updated Question Bank
OOJ-CIE 3 Updated Question Bank
2. Explain the different states of threads with neat diagram and example.
(or)
Explain in detail about the Java Thread Model/Java thread Lifecycle with a neat
diagram and example.
3. Explain isAlive() and join() method with programming example.
4. Describe the thread priority. Explain how to assign and get the thread priorities with
example.
5. What is need of synchronization? Explain with an example how synchronization is
implemented in java.
6. Write a Java program which creates 2 threads, one thread displays “VTU-Belagavi”
for every 10 seconds and another thread displays “Karnataka” for 5 seconds
simultaneously.
7. What is Regular Expression. Explain java.util.regex package to work with regular
expressions.
8. Write a short note on Pattern and Matcher class with example.
9. Demonstrate the methods matches() and find() giving the program as example with
outputs.
10.Demonstrate the split() and replaceAll() giving the program as example with outputs.
Module-5
1. Define Strings in java. Explain all the String Constructors in Java with syntax and
example for each and a program to demonstrate the same.
2. Explain following character extraction method:
a. charAt( )
b. getChars()
c. getBytes()
d. toCharArray( )
3. Explain the following String comparison with a program.
a. equals() and equalsIgnoreCase()
b. regionMatches()
c. startsWith() and endsWith()
d. compareTo()
4. Explain how strings can be modified in Java with different methods.
(or)
Explain how to modify a string by using following methods.
a. substring()
b. concat( )
c. replace( )
d. trim( )
5. What String Buffer? Explain how it is different from String in java with an example.
(or)
Differentiate between String and StringBuffer class. Write a program to demonstrate
the same.
6. Explain the following String Buffer methods:
a. insert( )
b. append( )
c. substring( )
d. replace( ).
e. reverse()
f. length()
g. delete()
7. Write a program to remove duplicate characters from a given string and display the
resultant string.
Lab programs
1. Implementation Java program to input N no. of strings, count the number of vowels
and digits in each string using Regular Expressions. (Lab pgm 7)
2. Implement a java program to validate USN and email ID of N students using Regular
Expressions. (Lab pgm 8)
3. Implement a java program to replace all instances of a substring with another within a
string. (Lab pgm 9)
4. Implement a java program to input a string and implement monoalphabetic Cipher.
(Lab pgm 10)