declare the Bank object outside of the if else scope, so you can access to it later, initialize that to null and assign a reference to a new instance of Bank
depending on the condition if-else
Bank account1 = null;
if(choice.equals("n")){
account1 = new Bank();
} else{
System.out.println("Enter your initial balance :");
double ibalance = scanner.nextDouble();
account1 = new Bank(ibalance);
}