If you look at the documentation:
The switch Statement (The Java™ Tutorials)[
^] it's pretty clear on the subject:
Quote:
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Enum Types), the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer
Since your class doesn't meet any of those criteria, you cannot use it in a switch.
To be honest, what you are doing looks pretty wrong: your class that deals with the account manipulation (deposits, withdrawals, and so forth) shouldn't be directly interfacing to the user: what if there are two different accounts? How would the user know which one he is affecting? The user interface should be separate from the "account mechanics", and should just pass info to the account handling class once it's been acquired and validated.