0 votes
10 views

What are static default methods in Java8?

in Education by (49.4k points)

1 Answer

0 votes
What are static default methods in Java8?

An interface can also have static helper methods from Java 8 onwards.

public interface vehicle {

   default void print() {

      System.out.println("I am a vehicle!");

   }

 

   static void blowHorn() {

      System.out.println("Blowing horn!!!");

   }

}
by (49.4k points)

Related questions

0 votes
1 answer 13 views
13 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 12 views
0 votes
1 answer 18 views
0 votes
1 answer 12 views
12 views asked Nov 19, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 11 views
0 votes
1 answer 20 views
0 votes
1 answer 13 views
0 votes
1 answer 10 views
10 views asked Nov 12, 2020 in Technology by JackTerrance (188k points)
0 votes
1 answer 11 views
0 votes
1 answer 12 views
0 votes
1 answer 31 views
0 votes
1 answer 10 views
10 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 12 views
12 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 10 views
10 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 11 views
11 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 9 views
9 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 10 views
10 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
...