Works fine for me. Aren't you missing scissors vs. rock though?
I think your program would be simpler if you created lowercase versions of the two things to compare and then just compared those...
Type: Posts; User: Squiffy
Works fine for me. Aren't you missing scissors vs. rock though?
I think your program would be simpler if you created lowercase versions of the two things to compare and then just compared those...
Your logic here is a bit tangled.
For instance, to find the maximum value, you need to do something like this:
max = 0
repeat for each list element:
x = next list element
if x > max then...
Thanks JavaPF!
Hey nice work. But I'd suggest one small change. Your getTransactions() method should simply "return transactions", nothing else.
In your main, then you can do: ArrayList transactions =...
Weird! I ran it with Eclipse "run" and had no problems.
You could try updating Eclipse. I have JRE7 too. Sounds like an Eclipse problem if it works elsewhere!
I think your Account class looks OK. But you need a getTransactions() method that returns the ArrayList of transactions.
The Transaction class does not need a list of transactions though. In your...
Just google "java main" -- you'll find an example of a main method straight away!
For example, if I've got a class called "Car" with a method called start() that I want to test, I could save the...
Firstly, you need to make sure that the transaction arraylist in your Account class is set to a new arraylist somewhere. Otherwise you've just got an empty reference that could refer to an array list...
Your code works fine for me (see tail end of output below).
So whatever the problem is, maybe it's not a Java problem. Have you tried other files? Do they all stop or just this one?
Read =...
Hi there,
My name's John, I moved to Budapest (Hungary) six months ago and now I'm making a living by teaching stuff on Skype and in person (mainly Java). Plus I'm developing some software to...