Professional Documents
Culture Documents
Dsy 2
Dsy 2
(EC – 695A)
ECE – 6th Sem. – 3rd Year
1. Write a Program in Java to print the bank details of two persons using method.
Program:
File Name: BankAcc.java
obj1.setValue("Soumen Pal",7000);
obj1.getValue();
obj2.getValue();
}
}
OUTPUT:
E:\JAVA\JAVA_FILES>javac BankAcc.java
E:\JAVA\JAVA_FILES>java BankAcc
Your Name: Soumen Pal
Your amount is: 7000.0
2. Write a Program in Java to show the bank details using method overloading.
Program:
File Name: BankAcc1.java
obj1.getValue();
obj2.getValue();
obj3.getValue();
obj3.setValue("Animesh Mondal");
obj3.getValue();
obj3.setValue(10000.50f);
obj3.getValue();
}
}
OUTPUT:
E:\JAVA\JAVA_FILES>javac BankAcc1.java
E:\JAVA\JAVA_FILES>java BankAcc1
Your name: abhijit kumar
Your amount is: 7000.0
3. Write a Program in Java to show the current amount and the amount withdrawn.
Program:
File Name: BankAcc2.java
OUTPUT:
Assignment No. – I Page - 4 Khatibur Rahman, 17/ECE/63, ECE Dept, FIEM
Object Oriented Programming Lab (Java) - OOPL
(EC – 695A)
ECE – 6th Sem. – 3rd Year
E:\JAVA\JAVA_FILES>javac BankAcc2.java
E:\JAVA\JAVA_FILES>java BankAcc2
Your name:Soumen pal
Your account balance is: 1000.0