create account

ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING by leoumesh

View this thread on: hive.blogpeakd.comecency.com
· @leoumesh ·
$2.35
ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING
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>
![Screenshot_3.png](https://images.hive.blog/DQmcLtFMhYVzGMYL7A5xtoC4c7nv82JzBTpwjsThwsnuTQk/Screenshot_3.png)
</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorleoumesh
permlinkabstract-class-and-method-in-java-programming
categoryhive-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"}
created2020-07-03 12:10:15
last_update2020-07-03 12:10:15
depth0
children1
last_payout2020-07-10 12:10:15
cashout_time1969-12-31 23:59:59
total_payout_value1.284 HBD
curator_payout_value1.064 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,143
author_reputation212,340,493,251,438
root_title"ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,317,020
net_rshares7,907,124,102,730
author_curate_reward""
vote details (34)
@gitplait-mod2 ·
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/)
properties (22)
authorgitplait-mod2
permlinkre-leoumesh-qcwerr
categoryhive-122108
json_metadata{"tags":["hive-122108"],"app":"peakd/2020.07.1"}
created2020-07-03 14:55:03
last_update2020-07-03 14:55:03
depth1
children0
last_payout2020-07-10 14:55:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length430
author_reputation28,898,670,427
root_title"ABSTRACT CLASS AND METHOD IN JAVA PROGRAMMING"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,319,570
net_rshares0