File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another way to write this

 
Gabriel White
Ranch Hand
Posts: 233
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is another way to write this without the ? and : ???



interFace is an array of 2 strings
superClass is an array of 2 strings
c is an object of the Class class.

I know that there is a way to do an if statement around this, but I don't want to hose my parameter list.

Thanks in advance.
 
Gabriel White
Ranch Hand
Posts: 233
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it basically if it is an interface (true) then just param the c as an interface and if not (else) then send in the superClass (true)???

Thanks
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
c = a ? b : d;

is the same as

if (a)
c = b
else
c = d

So you would have different method calls based on the condition c.isInterface()
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic