Java Programming

 

  1. Write a Java program to calculate the area of a circle, triangle, and rectangle using method overloading.

  2. Write a Java program to calculate the volume of a cone and a cylinder using method overloading.

  3. Write a Java program for calculating the area of shapes (circle and rectangle) using interfaces.

  4. Write a java program to define an interface which has methods area () volume (). Define constant PI. Create a class cylinder which implements this interface and calculate area and volume

  5. Define an interface Shape with an abstract method area(). Write a Java program to calculate the area of a circle and a sphere

  6. Define an abstract class Shape with abstract methods area() and volume(). Write a Java program to calculate the area and volume of a cone and a cylinder.

  7. Define an abstract class staff with protected members id and name. Define a parameterized constructor. Define one sub class office staff with member department. Create n objects of officestaff and display details

  8. Write application to accept 10 friend’s information like name, address, Date of birth, cell-phone number in array of object. Display accepted details.

  9. Write a package for games in java, which have two classes Indoor and Outdoor. Use a function display() to generate the list of players for specific games. (Use parameterized constructor, close() method and array of objects).

  10. Create package methods for two classes addition and substraction addition has method add ( ) to perform addition and substration has method sub( ) to purform substraction and display the result.

  11. Create a Package College which has two classes teacher and student. Teacher has two methods accept( ) and display( ) and student has two methods accept( ) and display( ). Display the given information of Teacher and Student.

  12. Write a package StrPack which has two classes Concat and Compare. Concat class has a method to concatenate two strings and Compare class has a method to compare two strings. Display appropriate messages

  13. Write a ‘java’ program to check whether given number is Odd or Even. (Use static keyword) 

  14. Write a Java program using static method which maintain bank account information about various customers.

  15. Write java application to define book class containing BookId, Title, author, rate, number of copies. Define parameterized constructor. Define method that will calculate cost of books. Accept details of five books in array of object from user display details along with cost of all books.

  16. Write a Java program to calculate the volume of a cone and a cylinder using method OVERRIDING

  17. Define class Student with attributes rollno, name. Inherit Student class in class marks, with attributes marks of java, marks of practical. Define method set marks () in class marks. Use parameterized constructor for initialization.

  18. Create a class Teacher (Tid, Tname, Designation, Salary, Subject). Write a java program to accept 'n' teachers and display who teach Java subject (Use Array of object)

  19. Write a java program to create a class Employee which contains data members as Emp_Id, Emp_Name, Basic_Salary, HRA, DA, Gross_Salary. Write member functions to accept Employee information. Calculate and display Gross salary of an employee. (DA=12% of Basic salary and HRA = 30% of Basic salary)to display employee information,Basic_Salary,Gross salary

  20. Create a Base class Train containing protected data members as Train_no, Train_Name. Derive a class Route (Route_id, Source, Destination) from Train class. Also derive a class Reservation(Number_Of_Seats, Train_Class, Fare, Travel_Date) from Route. Write java  program to perform following necessary functions :i. Enter  details of ‘n’ reservations ii.Display details of all reservations iii.Display reservation details of a specified Train class  

  21. Write a java program to create  a base class person (name, address, phoneno). Derive a class employee (eno,ename) from person derive a class manager (designation, department, basic-salary) from Employee. Accept all details of 'n' managers and display manager having highest basic salary.

  22. .Write a java program to create a base class Employee (Emp-code, name, salary). Derive two classes as Fulltime (daily_wages, number_of_days) and Parttime (number_of_working_hours, hourly_wages). Write a menu driven program to perform following functions:1.Accept the details of ' n ' employees and calculate the salary.2.Display the details of ' n' employees.