Abstraction is yet another important aspect of object oriented programming language. Think it as a really simple example, you might have send message from facebook to your friend, you just have to type text and then click send. You don't know the internal mechanism of how message is being sent. Abstraction means the same hiding details and showing only useful functionality to the user. This program is a simple demonstration of abstract class and method in java. There are two things that need to be kept in mind. First we can't create object of an abstract class and second the abstract method must be inside the abstract class. ``` package Polymorphism; abstract class sum{ public abstract void displaysum(); } class sumoftwonumber extends sum{ public void displaysum() { System.out.println("Sum has been displayed"); } } public class AbstractClass { public static void main(String[] args) { sum obj=new sumoftwonumber(); obj.displaysum(); } } ``` <br> Here's the output of the above code. <center>  </center>
author | leoumesh |
---|---|
permlink | abstract-class-and-method-in-java-programming |
category | hive-122108 |
json_metadata | {"tags":["java","programming","code","coding","tutorial","oop"],"image":["https://images.hive.blog/DQmcLtFMhYVzGMYL7A5xtoC4c7nv82JzBTpwjsThwsnuTQk/Screenshot_3.png"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2020-07-03 12:10:15 |
last_update | 2020-07-03 12:10:15 |
depth | 0 |
children | 1 |
last_payout | 2020-07-10 12:10:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.284 HBD |
curator_payout_value | 1.064 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,143 |
author_reputation | 212,340,493,251,438 |
root_title | "ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 98,317,020 |
net_rshares | 7,907,124,102,730 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
tombstone | 0 | 14,146,823,003 | 0.67% | ||
andyjim | 0 | 7,187,731,682 | 100% | ||
joythewanderer | 0 | 283,754,552,049 | 29% | ||
giantbear | 0 | 45,980,390,595 | 100% | ||
mys | 0 | 26,491,922,930 | 7.7% | ||
whd | 0 | 9,899,070,810 | 7.7% | ||
rafalski | 0 | 942,802,434 | 7.7% | ||
themarkymark | 0 | 1,854,454,034,650 | 9% | ||
tykee | 0 | 2,393,059,943 | 38.5% | ||
fbslo | 0 | 2,925,702,012 | 3.85% | ||
buildawhale | 0 | 4,375,408,310,265 | 9% | ||
therealwolf | 0 | 671,574,236,501 | 2.25% | ||
makerhacks | 0 | 21,468,958,569 | 9% | ||
smartsteem | 0 | 131,982,201,249 | 2.25% | ||
kamchore | 0 | 117,689,258,866 | 77% | ||
upmyvote | 0 | 6,663,339,231 | 9% | ||
leoumesh | 0 | 32,946,533,335 | 100% | ||
ipromote | 0 | 2,411,536,763 | 9% | ||
beleg | 0 | 3,505,678,794 | 7.7% | ||
archisteem | 0 | 2,518,684,525 | 7.5% | ||
digital.mine | 0 | 163,965,909,857 | 1% | ||
jk6276 | 0 | 45,865,312 | 1% | ||
julian2013 | 0 | 3,623,358,229 | 3.46% | ||
gorbisan | 0 | 3,725,066,622 | 1.92% | ||
laissez-faire | 0 | 56,537,953 | 100% | ||
abbenay | 0 | 932,913,838 | 4.5% | ||
pedrobrito2004 | 0 | 710,753,547 | 2.25% | ||
epicdice | 0 | 5,061,924,226 | 0.67% | ||
tinyhousecryptos | 0 | 532,767,301 | 5% | ||
jk6276.life | 0 | 4,622,831,143 | 5% | ||
marlians.photo | 0 | 1,437,271,160 | 100% | ||
educationhive | 0 | 51,413,253,331 | 100% | ||
gitplait | 0 | 55,962,829,879 | 77% | ||
multius | 0 | 687,992,126 | 100% |
Thanks for the lesson on abstract class. It's a topic of interest in our community. <sub> **Your post has been submitted to be manually curated by @gitplait community account because this is the kind of publications we like to see in our community.** </sub> Join our [Community on Hive](https://hive.blog/trending/hive-103590) and Chat with us on [Discord](https://discord.gg/CWCj3rw). [[Gitplait-Team]](https://gitplait.tech/)
author | gitplait-mod2 |
---|---|
permlink | re-leoumesh-qcwerr |
category | hive-122108 |
json_metadata | {"tags":["hive-122108"],"app":"peakd/2020.07.1"} |
created | 2020-07-03 14:55:03 |
last_update | 2020-07-03 14:55:03 |
depth | 1 |
children | 0 |
last_payout | 2020-07-10 14:55:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 430 |
author_reputation | 28,898,670,427 |
root_title | "ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 98,319,570 |
net_rshares | 0 |