i have a method that HAS to be public static void is there anyway to immediately end the method ?
Java instant end
I'm not sure what you're asking. If you explain yourself I'm sure you will get help.
Add some type of flag so that the excess instructions wont be executed.
I'm also really confused with what you want the method to do. I think I would also use a boolean. You can then keep the boolean outside of the method itself.
if(boolean)
{
//code here
}
if(boolean)
{
//code here
}
no no no your going about it all wrong. try something like this...
Im guessing that you are trying to have it exit out of the method and do what ever its suposed to do, you cold try a break statement, which will immediately end the method where ever it is. If you need to break out and retrun somehting, try a return statment
| Code: |
| public GUI( )
{ setTitle( "Lights ON!" ); setSize( 415, 365 ); setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); setLocationRelativeTo(null); setVisible(true); } |
Im guessing that you are trying to have it exit out of the method and do what ever its suposed to do, you cold try a break statement, which will immediately end the method where ever it is. If you need to break out and retrun somehting, try a return statment
| Code: |
| public GUI( )
{ setTitle( "Lights ON!" ); setSize( 415, 365 ); setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); setLocationRelativeTo(null); setVisible(true); break; OR return (char/int/souble/string here) } |
| NGRU-Kamikazie wrote: |
| no no no your going about it all wrong. try something like this...
|
No, we aren't going about it all wrong... First, how do you assume it's a GUI, and second, a break has to be in a loop or a switch and therefor it makes no sense to use a break to try to end a whole method, unless your whole method is a loop or switch.
H1 man's
please letter me site (or link) for download lost version Java mashine.
Thank
please letter me site (or link) for download lost version Java mashine.
Thank
I'm srry i was on a deadline for that and i didn't get a reply fast enough its been a while now and i can't remember what that was even for but i know i fixed it some how thx any way.
