This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes null strategy with enums/design patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "null strategy with enums/design patterns" Watch "null strategy with enums/design patterns" New topic
Author

null strategy with enums/design patterns

blondy khosa
Greenhorn

Joined: Apr 17, 2008
Posts: 1


public class TestStrategy{
private Strategy getStrategy(){
if(true){
return Strategy.DOCALCULATIONS;}
if(false){
return Strategy.DOANOTHER;}
return null; // my code will not work...I want to return a null strategy but //I don't how to do it...I have just started working with enums....please help with an example of code on how to do it
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: null strategy with enums/design patterns
 
Similar Threads
Need to create objects in each of my salty and sugary snack catagories
methods that causes nullpointer exception
Bind class to HttpSession?
My program wont work.
Switch abuse?