KEMBAR78
Practical List | PDF | Class (Computer Programming) | Method (Computer Programming)
0% found this document useful (0 votes)
29 views2 pages

Practical List

The document contains programming exercises involving classes, inheritance, exceptions, threads and applets. It includes tasks such as creating classes for books, employees and students, implementing inheritance hierarchies, working with packages, exceptions, threads and basic applet design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Practical List

The document contains programming exercises involving classes, inheritance, exceptions, threads and applets. It includes tasks such as creating classes for books, employees and students, implementing inheritance hierarchies, working with packages, exceptions, threads and basic applet design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1)Write a program to create class Book having data member s as title, Author and price.

Accept and
display data for one object.

2)Define a class employee with data members as empid, name and salary. Accept data for 5 objects
and print it.

3)Write a program to accept and print the addition of 2 numbers as command line arguments and
print the addition of those numbers.

4)Write a program to print reverse of a number.

5)Write a program to create class Student having methods getmarks and disp.the getmarks should
accept rno,name and marks of student and disp should print the same.

6)Create a class with 3 data members.Define a parameterized constructor to set values of first two
data members.define a method to calculate addition of numbers and print.

7)Write a program to print the following output.

11111

2222

333

44

8)Write a java program to implement following functions of string.

1)Calculate length of string

2)Compare between strings

9) Write a java program to implement following functions of vector

1)elementAt()

2)addElement()

3)removeElement()

10)
Class :Person

Name,age

Class:Employee
Emp_Desg,emp_sal
11)Write a java program to illustrate multilevel inheritance such that country is inherited from
continent. State is inherited from country. Display the place, state country and continent

12)Create an abstract class Employee. Derive two class manager and worker from it.use proper
methods to accept and display the details for the same .the fields of manager are
mid,mname,phno.similarly fields of worker are name and working hours.

12)

Interface:Gross Class:Employee

TA,DA Name
Gross_sal() Basic sal()

Class:Salary

Dsip_sal()

13)Create a package college which contains teacher class(name,degree).Teacher gas two methods
accept() and display().write a test outside of package to access teacher class.

14)Write a program to input and age of a person and throws an user define exception if entered age
is negative.

15)Write a program to create two threads ,one to print numbers in original order and other to
reverse orde from 1 to 50.

16)Write an applet to accept user name in the form of parameter and print

Hello<username>

17)design an applet program which displays a rectangle filled with red color and message as “Hello
third year Students”in blue color.

18)Write a program to design an applet to display three different colors on screen.

You might also like