/pay (rewritting to follow who.hidden)

/pay (rewritting to follow who.hidden)

Postby Warren1001 » 05 Jun 2013, 02:09

Errors:
Spoiler:


Command:
Spoiler:
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50

Re: /pay (rewritting to follow who.hidden)

Postby Conor » 05 Jun 2013, 02:20

Change:
Code: Select all
int amountPaid;

To:
Code: Select all
int amountPaid = 0;


Right now the compiler would be saying this: What happens if the amountPaid variable isn't assigned in the try statement? It is caught so there is no error and the code can continue to be read; however the amountPaid variable wouldn't have been assigned any value, and then you're trying to use it.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /pay (rewritting to follow who.hidden)

Postby Warren1001 » 05 Jun 2013, 03:09

Conor wrote:Change:
Code: Select all
int amountPaid;

To:
Code: Select all
int amountPaid = 0;


Right now the compiler would be saying this: What happens if the amountPaid variable isn't assigned in the try statement? It is caught so there is no error and the code can continue to be read; however the amountPaid variable wouldn't have been assigned any value, and then you're trying to use it.

ty :)
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 5 guests

cron