• + 0 comments

    class MyBook{ String title; void setTitle(String s){ this.title=s; }

    String getTitle(){
        return title;
    }
    

    }

    As we know the abstract classes can support only Declaration ,so we need another class to implement them.Here we use the getters() and setters() to implement them.

    -> setters() is used to set the value to variable -> getters() is used to return a value of variable