abstraction in java
Abstraction is nothing but the quality of dealing with ideas rather than
events. It basically deals with hiding the internal details and showing
the essential things to the user.
abstraction in java
Abstraction is nothing but the quality of dealing with ideas rather than
events. It basically deals with hiding the internal details and showing
the essential things to the user.
Abstraction in java
// example on abstract class in java
import java.util.*;
// abstract class
abstract class Shape
{
// abstract method
abstract void sides();
}
class Triangle extends Shape
{
void sides()
{
System.out.println("Triangle shape has three sides.");
}
}
class Pentagon extends Shape
{
void sides()
{
System.out.println("Pentagon shape has five sides.");
}
public static void main(String[] args)
{
Triangle obj1 = new Triangle();
obj1.sides();
Pentagon obj2 = new Pentagon();
obj2.sides();
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us