EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Create a class BankAccount with attributes account holder name,account number and balance. Include a methods for deposit and withdrawal

 

class BankAccount

{

String Holdername;

int AccountNo;

int Balance;

 

void deposit(int amount)amount=3000

{

Balance+=amount;//8000

}

 

void withdrawal(int amount)//1000

{

if(amount<=Balance)//1000<=8000

Balance-=amount;//7000

else

System.out.println(Insufficient Balance”);

}

 

void display()

{

System.out.println(Balance);//7000

}

 

}

class Main

{

public static void main(String args[])

{

BankAccount s1=new BankAccount();

s1.Holdername=”aaa”;

s1.AccountNo=123000;

s1.Balance=5000;

 

 

s1.deposit(3000);

  1. s1.withdrawal(1000);

s1.display();

 

}

}

Java code to find bank details

Leave a Reply

Your email address will not be published. Required fields are marked *

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer