You are on page 1of 1

Assignment 4

1) Write a program to read a number from user, store its factors into an array and
display the array.
2) Write a Java program using AWT to accept birthdate from user. If the birthdate
matches with system date, then wish the user “Happy Birthday”
3) Write a program which accepts a string from user and write only vowel characters
into the file “vowel.txt”
4) Create a package calculate which has two classes Square and SquareRoot.
Square has calc() method to calculate square of a number and SquareRoot has
calc() method to calculate square root of a number. Display the result using calculate
package.
5) What is autoboxing and unboxing of primitive types?
6) “Abstract class is a general purpose class (T/F)?”. Justify with suitable example.
7) Differentiate between TreeSet and HashSet
8) Can interface be final? Justify
9) Define an abstract class Hospital with protected member id and name. Define a
parameterised constructor. Define one subclass Doctor with member department.
Create n objects of Doctor class and display all details.
10) Develop an applet that receives 3 numeric values as input from the user and
then display the largest of three on screen
11) Write a Java program to accept ‘n’ movie names from the user. Insert into
arraylist and display the contents of the same array list. Also remove first and last
elements and display result.

You might also like