Final
Final
10. Implement the program to accomplish the following task using String & StringBuffer
class
a. To search a word inside a string.
b. To search last position of a substring.
c. To compare two string.
d. To print reverse of string
11. Develop a program that creates a vector to insert and display five elements of different
data types(use – elementAt(), insertElementAt(), addElement() etc. methods).
12. Implement the program to accomplish the following task using vector class
I. To add two integer, two float, two character, two string object
II. To search a particular object of the vector.
III. To display all object along with their index position.
IV. To delete all objects from vector
13. Develop a program to create a class “Book” having data members ‘auther’,’title ’
&’publisher’. Derive a class “bookInfo” having data member ‘prize’,’stock position’ & a
method ‘show()’. Initialize using constructor and display the information.
14. Develop a program to throw a user defined exception if the given number is not
positive.
15. WAP to accept a password from the user & throw “Authentication failure ” exception
if the password is incorrect.
16. Write a program to implement following hierarchy
class Print
display()
17. Define a package named ‘’useful’’ with a class named ‘useme’ having following
methods .
I. Area()->To calculate the area of given shape
II. Salary()->To calculate the salary given basic Salary, da, hra.
III. Percentage()-> To calculate the percentage given total marks and marks
obtained.
18. Write a program which will print minimum four system defined exceptions
19. Develop a program to create two threads such that one threads displays the message
“How do you do?” and the other thread displays the message “Fine, Thank you!”
20. Develop a program to create two threads one thread will print odd number up to 20
with delay of 100 milliseconds.
21. Develop a program to create two threads one thread will print 1 to 10 & other thread
will print 10 to 1 numbers. Frist thread should transfer control to second thread often
printing second number.
22. Develop a program to display a string “java Applet” on applet window using font
“Time New Roman”, size as 14 & style as BOLD+ITALIC .The string should be passed as a
parameter.
23. Write the applet program to draw square inside circle.
24. Write an applet program to draw rectangle which is filled with red color.
25. Write an applet program to draw (different) polygons.
26. Write a program to create an applet for displaying circle, rectangle and triangle one
below the other & filled them with red, green and yellow respectively
27. Develop a program to copy the contents of the file “abc.txt” into a new file “xyz.txt”.
28. Write a java program that reads a text file and prints every nth character from the
file where ’n’ should be passed as a command line argument.
29. .WAP to count number of characters in the file