• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
All of the following truths are shameless lies. But what about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic