• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Break Statement

 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can neone tell me how to exit from a function in java?break statement is not working...!!
Apart from return statement is there any other way?
 
Tom Wolve
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
usually 'return' is the 'right' way to exit a method in Java, throwing an exception is another.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by function? Can you post an example, as best as you have so far, of what you're trying to do?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic