Why wont this work? I dont understand class Book:     def __init__(self,_title,_author,_publisher,_copyright):         self._title = _title         self._author = _author         self._publisher = _publisher         self._copyright = _copyright     def title(self):         return("Title: " + self._title)       def author(self):         return("Author:" + self._author)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Why wont this work? I dont understand

class Book:
    def __init__(self,_title,_author,_publisher,_copyright):
        self._title = _title
        self._author = _author
        self._publisher = _publisher
        self._copyright = _copyright

    def title(self):
        return("Title: " + self._title)

 

    def author(self):
        return("Author:" + self._author)

 

    def publisher(self):
        return("Publisher:" + self._publisher)


    def copyright(self):
        return("Copyright:" + self._copyright)

b1 = Book("The stand","Stephen King","Pocket books","1996")
b1.title()
b1.author()
b1.publisher()
b1.copyright()

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,