Interfaces and classes must be outside of method bodies.
public class CarsDescription {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
}
interface Domestic {}
interface Import {}
interface Japanese extends Import {}
interface German extends Import {}
interface Detroit extends Domestic {}
interface SpringHill extends Domestic {}
interface Vehicle {}
interface Automobile extends Vehicle {}
interface LargeAutomobile extends Vehicle {}
interface Sedan extends Automobile {}
interface Van extends LargeAutomobile {}
interface Truck extends LargeAutomobile {}
interface Compact extends Automobile {}
interface SportsUtilityVehicle extends Truck, Van {}
class SaturnSL1 implements SpringHill, Sedan {}
class HondaCivic implements Japanese, Compact {}
class MercedesC230 implements German, Sedan {}
class ChevyS10 implements Detroit, Truck {}
class SubaruOutback implements Japanese, SportsUtilityVehicle {}
}
There is something to be said for putting each and every class and interface into its own file. But that is not required.
JeffGrigg
Posting Whiz in Training
218 posts since Aug 2011
Reputation Points: 192
Solved Threads: 28