Instead of using x = x + y, you should use x += y instead, its just shorter and more efficient, also I noticed your if statement (amount != 0). I recommend you use (amount > 0) to prevent a user from making a negative deposit. Otherwise, thanks for the awesome tutorial!
@rban1236 жыл бұрын
for the deposit function in bankAccount class you shoud use if(amount > 0) instead of if(amount != 0) because using != would allow user to put in negative inputs for a deposit which does not make sense
@samuelrajs35 жыл бұрын
very good !!!
@StrollerEngineer5 жыл бұрын
Well bro u r rite
@Mr-WesleySnipzzz5 жыл бұрын
YEEEET
@Ravikumar-op5qf5 жыл бұрын
Ryan, Bankers can do negative transactions. Suppose if your account is having only 10$ but they need to deduct 1000$ they can happily go and deduct and put your account in negative. So the given logic is correct.
@lmayliffe4 жыл бұрын
@@Ravikumar-op5qf No, this is wrong. You are confusing withdrawing more money than is available, and thereby putting the account into negative (which is totally fine) with allowing a deposit transaction to "deposit" negative money. The first is fine, the second is wrong. You cannot deposit negative money.
@jeremeskelton52722 жыл бұрын
I like this tutorial, and have decided to make a few changes, mostly for formatting and ease of use while running the application. First I changed all the inputs to a double so that I can enter a decimal value, as this would be similar to a banking transaction. I changed the outputs to a printf function to output an amount with 2 decimal places and enter a $ sign, I figure any monetary symbol could be used. I also added a .toUpperCase statement to the scanner for option, so that I don't have to use the "shift" key each time I selection an option. I also added to the switch cases for withdraw and deposit to show that the amount was entered and the current balance, so a balance check doesn't have to be performed after the transaction. The last thing that I need to figure out though is that if a withdraw action occurs and then checking for the last transaction, because the number is greater than 0, it states that a deposit was made. Which is not what actually happened.
@julchni31892 жыл бұрын
These videos are really helpful, I watch them with my friends on Voicely whenever we practice coding. We all agree that we learned more from KZbin videos than from school lol
@JuanLopez_1354 жыл бұрын
i feel as though balance should be always positive and if you try to withdraw an amount that is greater than the balance an insufficient funds message should pop up, makes it impossible to overdraft hypothetically as well i personally added some declarations in the withdraw method making the conditions having balance be greater than 0
@srikanthsrinivasan70403 жыл бұрын
can you plz share the code!
@halimaomar98202 жыл бұрын
I think you should include .toLowerCase() for the letter character options to deposit, withdraw etc. Because right now if you write a lowercase B then it will go to the default.
@wgualtieri11165 жыл бұрын
Great video. The music at the end cuts off the sound of what you were saying. Not sure you intended that.
@hdja72386 жыл бұрын
Try to use database, so when you close the program, u will have the the data
@saeedboos60246 жыл бұрын
why you dont use " if(amount > 0) " in deposit method instead of using "if(amount !=0)" because there is a chance to use -1 or any other negative numbers like -9 or -011?
@Mr-WesleySnipzzz5 жыл бұрын
that full blast music at the end was unnecessary
@dimakos334 жыл бұрын
I started searching where it was coming from. lol!
@mehriabdukodirova91554 жыл бұрын
@@dimakos33 Lol same
@josephramonfullah59302 жыл бұрын
thank you so much for this video. you really me on my major project but my problem now is the document of this project. please sir help me with the link of this project documentation.
@kalkrish22873 жыл бұрын
its a good one, if i want to see all transactions like statement what to do , He said Previous transactions but he written for Last Transaction anyway help some one here...Good work Albert.
@psgamer29043 жыл бұрын
you could add a string variable lets say stringPreviousTransactions="" in the BankAccount in withdraw method for example: withdraw(amount){ if(amount !=0){ balance -= amount; previousTransaction = -amount; } stringPreviousTransactions += "Withdrawn: " + Math.abs(previousTransaction)+ " "; } And do the same thing with the deposit method. Afterwards in the getPreviousTransactions method just print the stringPreviousTransactions.
@Mirelinin6 жыл бұрын
thank you very much! Amazing explanations! By any chance you could tell which changes could be made in this code in order to initially have it with "balance" of 850 EUROS and without a possibility to withdraw more than 850 EUROS (I.E. into the minus amounts, for example, -500)
@kawa_bata4 жыл бұрын
You need to create another if statement inside void deposit(int amount)
@PraveenOjwala5 жыл бұрын
THANK YOU ...Its really a great video...Got to know few sets... Can you please suggest me any other videos like this to get more info..
@mahesh1724 Жыл бұрын
Please do more n more video on BANKING APPLICATION .. I M WAITING FOR YOUR VIDEO SIR ..
@punammhaiske76095 жыл бұрын
I have small query- previoustrasaction Is a nonstatic variable so why didn't we create the object to used for it within method.
@theindiangamer32263 жыл бұрын
you should give this code in your Description.
@manjureddy61345 жыл бұрын
Very nice 👍 It would be nice if u would also give transfer option
@shahadtuglak19064 жыл бұрын
Best Tutorial an d Easy to Understand the Concepts Thankyou Sir❤
@berhanuget4 жыл бұрын
it is a nice guide to make this application. but Is it possible to add the gui form for this application if si How ?
@veereshwarvir80892 жыл бұрын
while(option != 'E') S.O.P(Thank you) if we select option e how is it printing the message inside the last while
@Offical_ThomasShelby27 күн бұрын
He added Case E because do while loop is a exit controlled loop which means in simple loop will once without checking do while loop condition. That's why if someone entered 'E' at first than the customer get thank you mssg
@pramodnarwade91513 жыл бұрын
BankAccount obj1=new BankAccount("XYZ", "BA00001"); is giving an error "no enclosing instance of type class is accessible. Must qualify the allocation with an enclosing instance of type Class".
@dmangee22 жыл бұрын
You declared your BankAccount class as inner class for BankingApplication. You need either move the whole BankAccount class into a separate file or declare it as static class BankAccount. What I did was create a new class and copy/paste everything except for the object you created into there.
@ganyrehs2 жыл бұрын
Check your spelling to see if the class name and constructor names are spelled correctly.
@samydoo996 жыл бұрын
I would add an if statement if you were to withdraw bigger than what your current balance is in your Withdraw method
@infosandfacts75366 жыл бұрын
if (amount2>balance){ System.out.println("Your balance is not sufficient for that amount!"); }else withdraw(amount2);
@jason_rivera4 жыл бұрын
What is "cname" and "cid" actually used for? It seems to me that they don't really do anything but I'm a beginner in Java, so if someone could please explain it to me, that would be awesome.
@nifrashibrahim42224 жыл бұрын
cname and cid, display for welcome message for the customer , that's the reason we created constructed in the class and pass the parameter
@ganyrehs2 жыл бұрын
BankAccount(String cname, String cid){ this.customerName = cname; this.customerId = cid; } cname and cid are method parameters and you can name them however you wish such as customerName and customerID. The String type needs to be there before the parameter names. You need to add parameters so when you create an object of the class type, you are able to pass those parameters. The tricky part is knowing what parameters to put into the constructor BankAccount. You can create a new BankAccount object such as: BankAccount accnt1 = new BankAccount("Jason", "555"); Jason is the cname (customer name) and 555 is the cid (customer ID). Most likely the customer ID will be a unique number which is only assigned to that particular account.
@darkoboy51332 жыл бұрын
Can i use these steps for electricity billing application
@nrmlboi79974 жыл бұрын
First of all Thank You So much. Sir, How to close scanner class? Could you make a small video on that with this project as the example.
@gibbyhart32034 жыл бұрын
add `scanner.close()` to the end of the showMenu() function and that will resolve that warning.
@lakshmidevilakshmidevi39842 жыл бұрын
Very helpful video
@prakashtayade19723 жыл бұрын
Dear sir, Use of JavaFx with this program will bring awesome user experience
@pravallikaoggu4718 Жыл бұрын
Excellent explanation ,Thanks a lot
@Mikey-mb6lb4 жыл бұрын
Very nice exercise! Worked perfectly and thank you!
@ramkumarp33302 жыл бұрын
Great work. Its really nice, Please share the source code for practice purpose.
@ali-imransabid67164 жыл бұрын
You use any excaption handaling?? please reply
@mahijangid73423 жыл бұрын
pls recheck withdraw method. because if our balance is low as amount we witdrawal. then it was successfully do the thing. which is wrong.
@nandkishorjawanjal3967 жыл бұрын
it's very helpful can u make a blood bank management system just like that bank
@AhmedMohamed-ro5yl6 жыл бұрын
thanks for this tutorial i had been motivated by this tutorial
@prabhukaveti64282 жыл бұрын
I want to print all the previous transactions.....how can I get....,..?
@vaibhavpanchal85222 жыл бұрын
Can I use this project as my mini project.
@Wolfiie95 Жыл бұрын
can i implement it in intelij? thank you so much
@wairegigithu95483 жыл бұрын
I'm grateful it worked...thanks
@bluelight22335 жыл бұрын
Thanks
@surya69110 ай бұрын
How to add front end for this??
@shivamchoudhary46554 жыл бұрын
Minimise all the unnecessary console on the left and right side as well as the lower output console...the code reading will become easy
@suraja10714 жыл бұрын
Can you please share the course code ? It would be a great help
@huzefaelyas96604 жыл бұрын
Why did u use String for customer id instead of int? Was it a mistake or any other reason?? I would like to know if any..
@nifrashibrahim42224 жыл бұрын
Yes good question , if you take look coding, if you pass the parameter in to constructor (String cname, int cid), then you should pass the parameter in to the object inside the main class .... BankAccount ba = new BankAccount("Nifrash", 25666); if you customer ID mix some string such as BA25666 cid should be String....
@huzefaelyas96604 жыл бұрын
@@nifrashibrahim4222 okay thank you I got it 👍👍
@williamkishore65703 жыл бұрын
How to create n number of accounts and get the values from the users?
@xomeluha58376 жыл бұрын
What configurations should I make in Eclipse to run this application
@infosandfacts75366 жыл бұрын
Just start a project as console App.
@PANKAJKUMARSINGH6734 жыл бұрын
Install jdk and then console project
@Matthew_080 Жыл бұрын
Thank you very much for your tutorial :)
@mattc20945 жыл бұрын
Hi Anthony, great comment you made in the Titanic H&G live stream... I'm also a Titanic enthusiast and was equally amazed when I saw Titanic H&G demo 3... it's astounding. May I ask, what got you interested in Titanic? cheers, matt
@TheCyberSatyr4 жыл бұрын
What ide do you use?
@shubhamk72734 жыл бұрын
sir in the above project we can withdrow without deposited amout then wts the problem sir?
@maryamaabdul77793 жыл бұрын
Is this a bank application system?
@jonathanndawula8584 Жыл бұрын
Well done 👍
@Introvert_Explorer7914 жыл бұрын
u don't do user to type the name and id on his/her own u created default as obj xyz i need user many user type his name id how to do it pls write the code reply
@muhammadsaeedindhar1304 жыл бұрын
The problem is that I can withdraw more amount then the deposited, how can I solve this ? And without depositing I am withdrawing , please help me out
@anwesharaul28184 жыл бұрын
have you figured out a way to fix that problem? If so can you please tell me how?
@aniketpatwa62004 жыл бұрын
@@anwesharaul2818 int the withdraw method in if condition you can use If ( amount >0 && balance >amount) And in else you can display message as Else System. Out.printtln("Not enough balance ");
@anwesharaul28184 жыл бұрын
Thank you.
@hushxbobful4 жыл бұрын
Try case 'C': { System.out.println("Enter amount to withdraw: "); int amount = scanner.nextInt(); if (amount < balance){ withdraw(amount); System.out.println("You have withdrawn: " + amount); System.out.println("Current Balance: " + balance); option = ' '; } else if (amount > balance){ System.out.println("Not enough Balance"); break; }
@Astralyang3 жыл бұрын
Is this the same as a java Bank card applet??
@saadmayo88224 жыл бұрын
Why it is giving error in Scanner keyword and option keyword.
@sikha4626 Жыл бұрын
Am i use this as a project in my resume.
@SkLDN1874 жыл бұрын
what software you using??
@rizishere193 жыл бұрын
Thank you so much. Simple, well explained and neat.
@kunalkheeva2 жыл бұрын
Thank you!! it was easy and simplified perfectly by you!!
@rechalchal12354 жыл бұрын
ur video good but testing what u did Exception in thread "main" java.lang.Error: Unresolved compilation problem: at BankAccount.main(BankAccount.java:6) brother please tell how to solve i followed ur tutorial
@golamrabbanimithu4 жыл бұрын
Please Give me source code? golamrabbani3010@gmail.com
@waleedahmed1523 жыл бұрын
Amount should be declared as a double variable. Would’ve been better to enhance the program
@vaishnavisherala3 жыл бұрын
Which app is used in this project
@deutschlinda77303 жыл бұрын
Thank you
@jaimikvandra68545 жыл бұрын
can we doing same example with collections
@rahulpradhan55856 жыл бұрын
I heartly thank you , this is really helpful video , great job sir..
@rkrk81463 жыл бұрын
How this can be a web application?
@hardeepsinghaujla46522 жыл бұрын
Hi i need help in one program
@donop75486 жыл бұрын
Can you please copy the code that you have typed, save it in a word document and give the link for downloading it? If you do so you will gain a loyal subscriber. Hope u reply...
@soroyo15364 жыл бұрын
Hello>>Is there a link for the source code?? and thank you for this nice and simple code
@heenakouser77333 жыл бұрын
Wow really good 👍👍
@iplay9783 жыл бұрын
how to add jframe ? please make a tutorial
@andrewsavage45573 жыл бұрын
Thank you bro Do more like this My support will be there👍
@DJ_MH_Remixes6 жыл бұрын
Can you upgrade your money ?
@sudhakeshari99584 жыл бұрын
Iska graphical user interface kaise bnaye
@alper20014 жыл бұрын
Whats the name of the music?
@johnchristiananay9082 жыл бұрын
Really helpful. Thankss!!
@akashubbu96474 жыл бұрын
Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:862) at java.util.Scanner.next(Scanner.java:1371) at BankAccount.showMenu(Banking.java:79) at Banking.main(Banking.java:8) i am having these error what should i do
@kesha54 жыл бұрын
Thank you for this video. This video is very helpful in my project but there is one error that doesn't sloved by me can you please help me sir. This is really important for me.
@pranalislifebook73364 жыл бұрын
Which error?
@suchithraraj53552 жыл бұрын
@@pranalislifebook7336 i am getting + operator is undefined for the argument type(s) string in void showmenu() function ---> +customername
@sohamnandi47084 жыл бұрын
could you tell me what what concepts were used in this tutorial..?? like inheritance etc
@gautamkamra35923 жыл бұрын
He used Do-while , if-else and switch case concepts
@ganyrehs2 жыл бұрын
There are no inheritance in this video. This shows basic ways to pass parameters in methods and creating a simple object from the class BankAccount.
@ganyrehs2 жыл бұрын
Inheritance would be if you have different types of accounts: Savings account, checking account, etc and then you can make the BankAccount class to be a super class.
@annirudharane84156 жыл бұрын
its not working in bluej
@balamuruganr63194 жыл бұрын
Nice...
@erfortymeri31444 жыл бұрын
why minecraft intro for java language? ik that minecraft is made form java but it wasnt in needed to show up. :|
@deepalinirmal65762 жыл бұрын
6:40 why did we take -amount?I didn't understand
@Offical_ThomasShelby27 күн бұрын
7:40 because we have to use condition if and else if to seperate deposition and withdrawal amount
@abhishekbhatt9486 жыл бұрын
i got error " Resource leak ,",scanner can't work. same code.
@sinaalipour83322 жыл бұрын
where can i find the source code
@jaydenwalbuck9503 жыл бұрын
Wouldn’t of watched but the Minecraft intro kept me here.
@australis27833 жыл бұрын
I love the way ok after every sentence shit had me rolling
@karannair30353 жыл бұрын
I literally didn't notice that and found it normal. Professors in India talk like that, so I'm used to it.
@karannair30353 жыл бұрын
But when I did notice I chuckled as well
@ArunKumar-pq6yj6 жыл бұрын
Pls can anyone provide the complete source code..
@DenzelVortex26226 жыл бұрын
can we use this project for major project for cse
@gagana_29 Жыл бұрын
Can I get this code please ???
@yq56874 жыл бұрын
how to combine it with gui??
@lumsmartin7 жыл бұрын
Is there a way this can be implemented with a Jframe?
@Blujay1887 жыл бұрын
definitely. It would be more lines of code, but the output would be much cleaner.
@kbestfriend30095 жыл бұрын
Can you please send us this project source code
@devchapaneria47765 жыл бұрын
If you find source code plz srnd me
@khushalrathod94955 жыл бұрын
i am getting error with do loop so pls help me
@nifrashibrahim42224 жыл бұрын
Check the open and close curly braces, send me the code the i will check and help to you
@upanyakrishnanur55603 жыл бұрын
How to print passbook
@madankandu38266 жыл бұрын
superb beginning
@visalsuy3 жыл бұрын
you are the best man
@angeshsingh83735 жыл бұрын
Thanks for posting the video It's helpful
@deepapattanshetty2114 жыл бұрын
Clarity of video is poor...... Plz update to clear quality videos