File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes  alternative available for If Else condiotion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark " alternative available for If Else condiotion " Watch " alternative available for If Else condiotion " New topic
Author

alternative available for If Else condiotion

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi,

I am using if ..else condition in my code for condition based coding...Is there any alternative available for If Else condition in java..!! please advise..!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Why? What's your beef with "if"?

If this is an interview question, please let us know. Such questions rarely make real-world sense and it'll save a lot of time trying to figure out why you are asking the question in the first place.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Bear Bibeault wrote:Why? What's your beef with "if"?

If this is an interview question, please let us know. Such questions rarely make real-world sense and it'll save a lot of time trying to figure out why you are asking the question in the first place.


It is just for my knowledge ...is there any alternative available to if else block!!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Knowledge is not acquired by making up random questions.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Saral Saxena wrote:
Bear Bibeault wrote:Why? What's your beef with "if"?

If this is an interview question, please let us know. Such questions rarely make real-world sense and it'll save a lot of time trying to figure out why you are asking the question in the first place.


It is just for my knowledge ...is there any alternative available to if else block!!


There are several possible alternatives. Which ones are applicable depends on exactly what you're doing in your if.

And of course, one has to ask why you want an alternative to if. In what way do you find it not suitable for the specific thing you're doing?
dennis deems
Ranch Hand

Joined: Mar 12, 2011
Posts: 808
The Java Switch statement
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: alternative available for If Else condiotion