jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes another way to write this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "another way to write this" Watch "another way to write this" New topic
Author

another way to write this

Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
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

Joined: Mar 02, 2003
Posts: 233
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

Joined: Feb 07, 2005
Posts: 2367
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
 
subject: another way to write this
 
Similar Threads
interface extending a an abstract class
Anonymous Classes
2 burning questions about URLyBird
Interface(URGENT)
protected constructors