Assignment I
Assignment I
PART – B
1 Explain the types of package with its importance
2i. What is method? How method is defined? give example(6)
ii. State the purpose of finalize() method in java? With an example
explain how finalize() method can be used in java program(7)
3i. What is class? how do you define a class in java(6)
ii. Define Package? How does compiler locate packages? Explain
arrays in java?(7)
4i. Explain the features of Java and list out the characteristics of
JAVA(7)
ii. Explain the characteristics of OOPs(6)
5Summarize the types of constructors supported by JAVA with
example.
6i. Discuss the usage of constructor with an example using java(7)
ii. Explain the object constructors and calling other constructor with
example(6)
7With relevant examples describe abstraction and encapsulation. Write
a java program that uses an abstraction and encapsulation.
8Illustrate what is polymorphism? Write a java program that implements
Polymorphism.
9Illustrate with an example the following features of constructors:
i. Default constructors (2)
ii. Parameterized constructor (2)
iii. Overloaded constructors (2)
iv. A call to another constructor with this operator( 2)
v. An object initialization block(2)
vi. A static initialization block(3)
10i. Illustrate OOPS and explain the features of OOPS (7)
ii. Demonstrate the static fields and methods used in java (6)
11 i. Distinguish argument and parameter? Discuss with example(7)
ii. Differentiate constructor and method with example(6)
12 Difference between OOPS and procedural programming language
13 Assess the different methods in java. Util. Arrays class with example
14Create a Java program for push and pop operations in stack using
arrays in classes and object
PART – C
1Write a program to perform the following functions using classes,
objects, constructors and destructors where essential
i. Get as input the marks of 5 students in 5 subjects (5)
ii. Calculate the total and average (5)
iii. Print the formatted result on the screen (5)
2Make a class Student. The Student class has data members such as roll
number, name, branch. Create a class called Exam that has data
members roll number and six subject marks. Derive the result class
from Student and Exam it has own data members such as total mark,
and result. Write a Java program to model the relationships.
3Create a java program to find a smallest number in the given array by
creating one dimensional array and two dimensional array using new
operator.
4i. Write a Java program to Evaluate the following series 1-2+3-
4+…+n .(8)
ii. Write a Java program to test the prime numbers between the given
two limits(7)