• 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

This file looks weird, but it compiles

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
import java.io.*;

abstract interface Veloz { void metodo(String x); }
public class A {
private abstract interface Veloz{ Number metodo(int x); }
abstract static class B{
private abstract static interface Veloz{void metodo(long x) throws Exception;}
public void metodo(){
class Opa implements Veloz{
public void metodo(long x) throws IOException { }
}
}
}
public void test(){
class Opa2 implements Veloz{
public Integer metodo(int x) throws RuntimeException {
return (Integer)(int) .5f;
}
}
}
}
===========================
private abstract static interface?
abstract static class?
I don't understand. Hopefully I don't get all confused and messed up before taking the exam.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Allen wrote:import java.io.*;

abstract interface Veloz { void metodo(String x); }
public class A {
private abstract interface Veloz{ Number metodo(int x); }
abstract static class B{
private abstract static interface Veloz{void metodo(long x) throws Exception;}
public void metodo(){
class Opa implements Veloz{
public void metodo(long x) throws IOException { }
}
}
}
public void test(){
class Opa2 implements Veloz{
public Integer metodo(int x) throws RuntimeException {
return (Integer)(int) .5f;
}
}
}
}
===========================
private abstract static interface?
abstract static class?
I don't understand. Hopefully I don't get all confused and messed up before taking the exam.



Interfaces can be members of class definitions and can be declared private or protected there. Inner class is similar.
 
Greenhorn
Posts: 1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
class in class which is static is static nested class (not static is inner class).

Nested classes
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic