main method Take the values at runtime using Scanner class Create an object for SCOPE class Invoke DisplayDetails method

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

 

Write a java code for the following.

Inheritance

Define a class Person

  • Define instance variables Name, Age, Address
  • Define a parameterized constructor to initialize the above instance variables

Define a class Student which inherits from Person class

  • Define instance variables RollNumber, Marks
  • Define a parameterized constructor to initialize super class instance variables and the above instance variables

Define a class SCOPE which inherits from the Student class

  • Define instance variables Branch
  • Define a parameterized constructor to initialize super class instance variables and the above instance variables
  • Define a method DisplayDetails to display all the details such as Name, Age, Address, RollNumber, Marks, and Branch

Define a class for main method

  • Take the values at runtime using Scanner class
  • Create an object for SCOPE class
  • Invoke DisplayDetails method
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Development strategies
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,