BankingApplication | Java Console Application Based on Local MySql
kandi X-RAY | BankingApplication Summary
kandi X-RAY | BankingApplication Summary
Java Console Application (No Gui) Based on Local MySql Server. Built For Educational Purposes
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BankingApplication
BankingApplication Key Features
BankingApplication Examples and Code Snippets
Community Discussions
Trending Discussions on BankingApplication
QUESTION
Scanner scan = new Scanner(System.in);
AccountList accounts = new AccountList();
accounts.addAccount(new BankAccount(100000, "Mark", "BA0021"));
accounts.addAccount(new BankAccount(367000, "John", "BA0022"));
accounts.addAccount(new BankAccount(94500, "Michael", "BA0023"));
accounts.accessAccount("BA0021").checkBalance();
String temp = "BA0022";
accounts.accessAccount(temp).checkBalance();
**temp = scan.nextLine();
accounts.accessAccount(temp).checkBalance()**;
...ANSWER
Answered 2020-Dec-05 at 05:26As Slaw pointed out, the error is from the checkBalance()
method. I believe that the account number passed as parameter to this method is not assoicated to any account and thus, checkBalance()
returns null
(as no Account
object is associated with the account).
This can be due to scan.nextLine()
which reads entire line. You can test it by
QUESTION
I'm new to coding and following a tutorial on YouTube for creating a simple Banking Application.
I'm getting an error: Syntax error on token ";", { expected
I've outlined where the error is in my code below.
Things I've tried:
- I've taken a look at the braces and they look fine to me.
- I've taken a look at the other similar questions on here and they don't seem to help.
- Google'd and still can't figure out what's causing this frustrating error.
- Google tells me it's something to do with brackets maybe but i can't see the problem?
Code Below:
...ANSWER
Answered 2020-Mar-09 at 05:33You need to encapsulate your switch statement in brackets (just like you would for a method):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BankingApplication
You can use BankingApplication like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the BankingApplication component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page