Interface in Java is similar to the abstract class where you can't instantiate the class i.e. create the objects of the class. The following are the features of the interface in java: 1. All the methods within interface block are by default `public` and `abstract`. 2. In order for the interface method to work, another class needs to implement that interface using `interface`keywords. This is a simple program demonstrating the use of `interface` in java. ``` interface A{ void output(); } class B implements A{ public void output() { System.out.println("Printing output for Interface Class"); } } public class InterfaceClass { public static void main(String[] args) { A a1=new B(); a1.output(); } } ``` <hr> The output of this code is as follows: <center> ![Screenshot_1.png](https://images.hive.blog/DQmTWTp4bTbuY4QbWzM866ud8kKrTjhhpZwVCc7MH2i9Rwg/Screenshot_1.png) </center>
author | leoumesh |
---|---|
permlink | interface-in-java-programming |
category | hive-181925 |
json_metadata | {"tags":["hive-181925","java","programming","tutorial","code","coding","learning","education"],"image":["https://images.hive.blog/DQmTWTp4bTbuY4QbWzM866ud8kKrTjhhpZwVCc7MH2i9Rwg/Screenshot_1.png"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2020-07-07 06:15:15 |
last_update | 2020-07-07 06:15:15 |
depth | 0 |
children | 0 |
last_payout | 2020-07-14 06:15:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 3.554 HBD |
curator_payout_value | 2.767 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 898 |
author_reputation | 202,357,414,008,705 |
root_title | "INTERFACE IN JAVA PROGRAMMING" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 98,384,705 |
net_rshares | 18,358,638,223,716 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
tombstone | 0 | 18,672,102,008 | 0.9% | ||
logic | 0 | 443,655,975,966 | 100% | ||
steemcleaners | 0 | 6,722,577,930,447 | 100% | ||
travelnepal | 0 | 16,107,146,423 | 100% | ||
themarkymark | 0 | 2,414,238,311,404 | 12% | ||
buildawhale | 0 | 5,666,245,129,856 | 12% | ||
therealwolf | 0 | 845,514,212,545 | 3% | ||
makerhacks | 0 | 27,661,523,208 | 12% | ||
revan746 | 0 | 29,341,623,927 | 100% | ||
smartsteem | 0 | 172,726,233,635 | 3% | ||
upmyvote | 0 | 8,649,742,721 | 12% | ||
fun2learn | 0 | 5,339,899,944 | 3% | ||
tobias-g | 0 | 40,299,537,459 | 9% | ||
leoumesh | 0 | 30,815,521,692 | 100% | ||
raise-me-up | 0 | 208,249,951,930 | 100% | ||
ipromote | 0 | 2,991,024,917 | 12% | ||
frassman | 0 | 791,202,371 | 5% | ||
kgakakillerg | 0 | 23,785,992,932 | 10% | ||
suonghuynh | 0 | 172,131,395,169 | 6% | ||
dalz | 0 | 5,441,586,094 | 1.8% | ||
smartvote | 0 | 183,093,443,830 | 6% | ||
jk6276 | 0 | 29,038,558 | 1% | ||
laissez-faire | 0 | 58,834,674 | 100% | ||
abbenay | 0 | 1,265,487,911 | 6% | ||
epicdice | 0 | 5,762,981,858 | 0.9% | ||
tinyhousecryptos | 0 | 532,625,229 | 5% | ||
delegate4food | 0 | 545,412,234 | 45% | ||
bilpcoinbpc | 0 | 2,170,488,504 | 50% | ||
hivewatchers | 0 | 230,401,726,600 | 65% | ||
thepeakstudio | 0 | 80,054,283,520 | 100% | ||
kingfadino | 0 | 998,341,743,709 | 50% | ||
hivecur2 | 0 | 1,146,112,441 | 3% |