Answer:
import java.util.Scanner;
class BankAccountTest {
public static void main(String[] args) {
String name;
String ssn;
Scanner in = new Scanner(System.in);
// Receive User input
System.out.println("Enter Your Name");
name = in.nextLine();
System.out.println("Enter Your Social Security Number");
ssn = in.nextLine();
//Creating an object class BankAccount
BankAccount newAccount = new BankAccount(name,ssn);
}
}
Step-by-step explanation:
Using Java Programming Language
Use Scanner class to read values for name and social security numbers and store in the respective varibles
Make an object of the class BankAccount and supply to values to constructor call
Assume that the class BankAccount exists with the member feilds for name and ssn as below:
public class BankAccount{
//Class member variables
private String name;
private String ssn;
//Constructor
public BankAccount(String name, String ssn) {
this.name = name;
this.ssn = ssn;
}
}