1.

How Will You Call A Static Method Of An Interface In A Class?

Answer»

USING NAME of the INTERFACE.

interface Vehicle {
static void blowHorn(){
System.out.println("Blowing horn!!!");
}
}
class CAR implements Vehicle {
public void PRINT(){
Vehicle.blowHorn();
}
}

Using name of the interface.

interface Vehicle {
static void blowHorn(){
System.out.println("Blowing horn!!!");
}
}
class Car implements Vehicle {
public void print(){
Vehicle.blowHorn();
}
}



Discussion

No Comment Found