Read up on it
Enums return integers![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Sry for double post....
Read this? Java: Enums
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Yeah, but that page also gives an example on using them with case statements.
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Great.. sorry didn't see the link.. I think we posted at the same time. Gonna take a look at it now.
Oh, ok![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
So there the user can input a string and the compare it to the enum and the get the value of the enum?
Dunno, didn't read the details..
This is what you need.... You just make an enum (MyDearStringEnumCode:switch (drawing) { case RECTANGLE: (...)) with these string
elements ("black", "blue", "yellow", "TcM" etc) and put
switch (MyDearStringEnum)
case "black": etc...
Or just use ifs.
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Yeah and they you just get the value or whatever you need.. Thanks![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks