• Post Reply Bookmark Topic Watch Topic
  • New Topic

interface for nested classes  RSS feed

 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following class

public class SampleImport{

public SampleResult import (InputSource xml) {
SampleResult sampleResult = new SampleResult();
//do something
return sampleResult;
}

public static class SampleResult {
public final String sampleName;
public SampleResult (String s) {
sampleName = s;
}
}

}


I would like to create an interface for this class for teh following method signature 'SampleResult import(InputSource(xml))', how would I create it ?

Any help is appreciated,
TIA,
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interfaces can actually contain nested classes; they are implicitly static. Perhaps it would be appropriate to move this nested class to your interface.
 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!