in Education by

How will you call a static method of an interface in a class in Java8?

Please log in or register to answer this question.

1 Answer

0 votes
by

How will you call a static method of an interface in a class in Java8? Using name of the interface. interface Vehicle { static void blowHorn() { System.out.println("Blowing horn!!!"); } } class Car implements Vehicle { public void print() { Vehicle.blowHorn(); } }

Related questions

0 votes
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
asked Nov 8, 2020 in Education by Editorial Staff
...