Assignment
Assignment
Assignment-2
Assignment-3
13.Display Hello world on console without creating any object and writing
any code in main method.
Count number objects create from class using static variable.
Also show the execution priority for Static block, initialization block,
static main method
14.Demonstrate how to use static data member and static method, non static
data member and non static method, in static method and non static
method.
Let, a is non static data member and b is static data member. Display is
non static method and show is static method. Both methods contain
addition logic for data member. Show that how a, b and display method is
accessible in show method. Also show that how a, b and show method
accessible in display.
19.Demonstrate how you are using access and non access specifier for
solving following problem.
Problem statement - Assume that the bank maintains two kinds of
account of its customers, one called saving account and the other current
account.
The saving account provides compound interest and withdrawal facility
but no cheque book facility. The current account provides cheque book
facility but no interest.
Current account holders should also maintain a minimum balance and if
the balance fall below the this level, a service charges imposed.
Create a class Account that stores customer name, account number and
type of account.
From this class Current-Account and Saving-Account, make them more
specific to their requirements. Includes necessary methods in order to
achieve the following task:
a) accept deposit from customer and update balance.
b) display the balance for account
c) display banks opening and closing balance and check this balance
is same after performing all transaction made on that period.
d) Compute and deposit interest.
e) Permit withdrawal and update balance
f) check for minimum balance, impose penalty if necessary and
update balance.
g) create and assign system generated account number to customer.
h) check no two customer contain same details, if details are same
then mark account as duplicate and make sure that duplicate type is
not allowed to change. Also delete previous account and update all
details in new account. (show the use of static, final, abstract and
access specifier). If required assume suitable data and mention
your assumption in program - either in comment form or call
method to print assumption on console.
20.Demonstrate different types of inner classes and show how to access data
member and methods in inner class. Also show how to access inner class
method.
22.Write difference between nested class and static nested class. Mention
reason for why outermost class not allows with non access specifier
static.
23.Create a Outer Class contain non static data member a and static data
member b. Perform the addition of a and b, show result in data member.
(Inner Class- non static).
24.Create a student class. Student class contain the Create non-static data
member for storing information about 4 years mark and pass percentage.
Count the number student above BB grade.
25.To write a Java Program to design an abstract class / interface class for
Stack ADT and implement Stack ADT operation using array.
a) Create single level inheritance with parent class is abstract class.
b) Create single level inheritance in which parent class is interface
class.