
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Use the given Java code on the left side of the photo:
![Codio
Project
File
Edit
Find
View
Tools
Education
Help
Configure.
Virtual Desktop
O Configure.
CMANALILI
Exercise3.java
Inheritance E.
class Parentl {
public String identify() {
return "This method is called from Parentl";
}
}
2
Collapse
Inheritance -> Coding Exercises - Inheritance
3
4
Inheritance Exercise 3
6
7
class Parent2 {
public String identify () {
return "This method is called from Parent2";
}
}
Exercise 3
10
11
12
Create the class Child such that the following criteria are met:
13
//add class definitions below this line
14
15
• Child is a subclass of Parent1 and Parent2
16
• Override identify so that it returns "This method is called from Child"
17
//add class definitions above this line
18
• Create the method identify2 that invokes the identify method from Parent2 .
public class Exercise3 {
public static void main(String[] args) {
19 -
20
• Create the method identify3 that invokes the identify method from Parent1
21
22
//add code below this line
Important, Changes will need to be made to the Parent1 and/or Parent2 classes.
Expected Output
//add code above this line
}
}
The table below shows the expected output for the indicated instantiation. Use the
TRY IT button below and verify that your Child object works as expected.
First, instantiate a Child object:
//add code below this Line
Child childobject = new Child();
//add code above this Line
Print Statement
Output
System.out.println(childObject.identify());
his method is called from Child
This method is called from
System.out.println(childObject.identify2());
Parent2
This method is called from
System.out.println(childobject.identify3());
Parenti
TRY IT
0% (1:0)
Java](https://content.bartleby.com/qna-images/question/675f953f-bef5-43c0-8ba9-513be4b8b383/2751c8dd-9ef0-46ac-a76c-594d36c628f9/5apami_thumbnail.png)
Transcribed Image Text:Codio
Project
File
Edit
Find
View
Tools
Education
Help
Configure.
Virtual Desktop
O Configure.
CMANALILI
Exercise3.java
Inheritance E.
class Parentl {
public String identify() {
return "This method is called from Parentl";
}
}
2
Collapse
Inheritance -> Coding Exercises - Inheritance
3
4
Inheritance Exercise 3
6
7
class Parent2 {
public String identify () {
return "This method is called from Parent2";
}
}
Exercise 3
10
11
12
Create the class Child such that the following criteria are met:
13
//add class definitions below this line
14
15
• Child is a subclass of Parent1 and Parent2
16
• Override identify so that it returns "This method is called from Child"
17
//add class definitions above this line
18
• Create the method identify2 that invokes the identify method from Parent2 .
public class Exercise3 {
public static void main(String[] args) {
19 -
20
• Create the method identify3 that invokes the identify method from Parent1
21
22
//add code below this line
Important, Changes will need to be made to the Parent1 and/or Parent2 classes.
Expected Output
//add code above this line
}
}
The table below shows the expected output for the indicated instantiation. Use the
TRY IT button below and verify that your Child object works as expected.
First, instantiate a Child object:
//add code below this Line
Child childobject = new Child();
//add code above this Line
Print Statement
Output
System.out.println(childObject.identify());
his method is called from Child
This method is called from
System.out.println(childObject.identify2());
Parent2
This method is called from
System.out.println(childobject.identify3());
Parenti
TRY IT
0% (1:0)
Java
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- I need help writing a program using the DrawingPanel that contains a method for drawing a checkerboard. The checkerboard should be 160 units wide (and tall) and should have an input parameters that allow the method to place the checkerboard at any x and y coordinates. For example you should be able to do the following in your main program.drawCheckerboard(100,100, myG);drawCheckerboard(120,500, myG);To draw two different checkerboards.You may choose your own colors for the squares on the checkerboard.arrow_forwardCan you make the triangle that is on top a different color other then red pleasearrow_forwardOutput the numbers 1-100 inclusive starting with 1. Please a comma and a space after each number except the last. Output a new line after the last number. Write a code in Java that results like test case 1arrow_forward
- Please use 6.7 to answer 6.10. Please sent the screenshoots of the program. Please also only answer 6.10.arrow_forwardI need help with the Java code so that it can output as shown in the image below: Input is a csv file like this - (The csv file is : 16:40,Wonders of the World,G 20:00,Wonders of the World,G 19:00,Journey to Space ,PG-13 12:45,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG 15:00,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG 19:30,Buffalo Bill And The Indians or Sitting Bull's History Lesson,PG 10:00,Adventures of Lewis and Clark,PG-13 14:30,Adventures of Lewis and Clark,PG-13 19:00,Halloween,R ) The code the I need help fixing: import java.util.Scanner;import java.io.FileInputStream;import java.io.IOException; public class LabProgram { public static void main(String[] args) throws IOException { Scanner scnr = new Scanner(System.in); // Read the file name from the user String fileName = scnr.nextLine(); // Open the CSV file try (Scanner fileScanner = new Scanner(new FileInputStream(fileName))) {…arrow_forward(YOU ARE NOT ALLOWED TO USE ARRAYLIST IN THIS PROJECT)Write a Java program to simulate a blackjack game of cards. The computer will play the role of the dealer. The program will randomly generate the cards dealt to the player and dealer during the game. Cards in this game will be represented by numbers 1 to 13 with Ace being represented by a 1. Remember, that face cards (i.e. Jack, Queen, and King) are worth 10 points to a hand while an Ace can be worth 1 or 11 points depending on the user’s choice. The numbered cards are worth their number value to the hand.arrow_forward
- (PLEASE USE JAVA AND JFRAME GUI) Game rules:The game consists of a two-dimensional field of size m × n (game field). Each element ofthe game field is a button with a number assigned to it.Initialization of the game:• The numbers on the buttons of the game field are set to a random digit between 0and 9• The target value is displayed above the game field• The current sum of the numbers displayed on the buttons of the game field is printedbelow the game field• The number of moves to completion is displayed in the upper right corner above thegame field.Playing:The first move is determined by the player by selecting any button (button A) on thegame field.1. The player is allowed to choose a second button (button B) located in the columnor row of the previously selected button (A).2. Upon selecting the second button (B), the value of button (A) is updated accordingto the following formula: A = (AoperationB)mod10.3. The operation for the basic game will be +.4. Decrement the number of moves…arrow_forwardUsing Java: (Sum the areas of geometric objects) Write a method that sums the areas of all thegeometric objects in an array. The method signature is:public static double sumArea(GeometricObject[] a) Write a test program that creates an array of four objects (two circles and tworectangles) and computes their total area using the sumArea methodarrow_forwardThis is in Python. I'm using IDLE. Create a shape with turns of 45 which is 50 on a side. Make sure the sides come back together forming a octagon (stop sign) shape. Note: So far I had to make a square and a circle. This was the code. import turtle turtle.write("micpor9577")turtle.pencolor("purple")turtle.right(90)turtle.forward(100)turtle.right(90)turtle.forward(100)turtle.right(90)turtle.forward(100)turtle.right(90)turtle.forward(100) turtle.pencolor("blue")turtle.circle(50)turtle.donearrow_forward
- Draw the four endpoints of the rectangles given in the java statements. 1. g.drawRect(600, 0, 200, 450)arrow_forwardWrite a code using C# for the following images.arrow_forwardYou are working as a software developer on NASA's Mars Explorer robotic rover project. You need to implement some code to compute the surface area of the 3D, tube-shaped part shown below: a cylinder of radius r and height h (in units centimeters) with a hollowed-out center also in the shape of a cylinder with radius n and height h (also in cm). Both the outside and the inside of the tube will need to be coated in a thin layer of gold, which is why we need to know its surface area. Write code that will compute and print the total surface area of the shape. n esc r Examples: Inputs r = 10, n = 8.5, h = 22.5 r = 9.25, n = 6.8, h r = 4.15, n = 3.9, h = 11.7 = 12.16 X h Output Value 2789.7342763877364 1473.347264273195 604.4267185874082 2 3 80 F3 000 DO F4 ✓0 F5 完成时间:18:42 PNEUE MacBook Air F6 F7 DII F8 tv 8 F9 F10 Farrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education