h have this code i want connect "account_num" to class how i can do it?
this is controlling class
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
Bank1 ob1 = new Bank1();
Bank2 ob2= new Bank2();
ob1.accountname();
ob2.blance();
ob2.withdraw();
ob2.deposit();
System.out.println("****************************"+"/n BANK AL-KHUWAIR"+
"/n****************************");
System.out.print("Enter your Bank Account Number : ");
int account_num = sc.nextInt();
System.out.println("Welcome to "+ob1.account_num);
this is class
package B1;
public class Bank1 {
//im not sure
public void accountname(int account_num)
{
if (account_num == 100)
{
System.out.println("Dr.Shabber Shaikh");
}
else if (account_num == 101)
{
System.out.println("Mr.hitesh");
}
else if (account_num == 102 )
{
System.out.println("Mr.Hari");
please help me and thanks
Aucun commentaire:
Enregistrer un commentaire