This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

null strategy with enums/design patterns

 
blondy khosa
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic