Professional Documents
Culture Documents
Worksheet 2
1. Create an abstract class shape with abstract method to calculate area of various shapes
like rectangle, triangle, square and non-abstract method to get corresponding inputs for area
calculation. abstract class shape
{ Var ………..
abstract void area(); void
input(….)
{……………. }}
class xyz extends shape
{
2. Create a class Bank and define final method to display fixed loan amount of Rs.1500000
of personal loan and implement various methods to display various loan schemes.
(if age is <=25 eligible for education loan of 10,00,000 if
Output:
3. Design a Java package for numbers. Develop two different classes that belongs to two
package, one for to check whether the given number is palindrome or not and the other to
check whether the given number is odd or even and access these package using one main
file.
Pack1- palindrome Pack2- odd/even Pack3- third- main()-call
Source Code:
Output:
Source Code:
Output: