Untitled

mail@pastecode.io avatar
unknown
plain_text
3 days ago
729 B
1
Indexable
Never
import java.lang.*;
public class Account{
	//instance variables
	private	int accountNumber;
	private	String accountHolderName;
	private	double balance;
	
	public Account(){
		System.out.println ("Empty constructor called:");	
			
	}
	public Account(int accountNumber, String accountHolderName, double balance){
		System.out.println ("Parametrized constructor called:");
		this.accountNumber = accountNumber;
		this.accountHolderName = accountHolderName;
		this.balance = balance; 
		
		
	}
	public void showDetails(){
		System.out.println("Account number: "+ accountNumber);
		System.out.println("Account holder name: "+ accountHolderName);
		System.out.println("Account balance: "+ balance);
		
		}
	
}
Leave a Comment