• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

abstract interface

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been using the SCPJ2(exam 310-025) for a study guide. I like the layout but the number of incorrect stmts and mock answers is to much to stand.
Anyway, one of the claims in the book is that an interface can't be declared as abstract. However, I compiled and ran the code below with no problem.(JBuilder 3) Anyone have a definitive answer on this??
abstract interface next
{
public final static int test = 4;
public void foo(int j);
}

public class examprep implements next
{
public examprep()
{
}
public void foo(int j)
{
}
public static void main(String[] args)
{
examprep instance = new examprep();
instance.foo(3);
}
}
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer that I can give is that interfaces are implicitly abstract and hence have no need to be explicitly stated as such. The reason for this is that their methods must be abstract.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic