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
IV. Will the following java code compile? if not why? if yes write the output. abstract class A { abstract void callme(); // concrete methods are still allowed in abstract classes void callmetoo() { System.out.println("This is a concrete method."); } } class B extends A { void callmetoo() { System.out.println("B's implementation of callme."); } } class AbstractDemo { public static void main(String args[]) { B b = new B(); b.callmetoo(); } } }
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 3 steps with 1 images
Knowledge Booster
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
- Java: Derive the class ExtClock from the class Clock by adding a data member to store the time zone. Add necessary methods and constructors to make the class functional. Also write the definitions of the methods and constructors. Here is the code: public class Clock{private int hr;private int min;private int sec;public Clock(){setTime(0, 0, 0);}public Clock(int hours, int minutes, int seconds){setTime(hours, minutes, seconds);}public void setTime(int hours, int minutes, int seconds){if (0 <= hours && hours < 24)hr = hours;elsehr = 0;if (0 <= minutes && minutes < 60)min = minutes;elsemin = 0;if(0 <= seconds && seconds < 60)sec = seconds;elsesec = 0;}public int getHours(){return hr;}public int getMinutes(){return min;}public int getSeconds(){return sec;}public void printTime(){if (hr < 10)System.out.print("0");System.out.print(hr + ":");if (min < 10)System.out.print("0");System.out.print(min + ":");if (sec <…arrow_forwardJavaarrow_forwardList out the errors in the following code?arrow_forward
- Given the following code and instructions:Is the provided implemented correctly for said instructions?The main class Ride contains: public abstract boolean ableToRun(int numberofRuns);public abstract boolean checkRide(String[] components);public abstract double costPerPassenger(int numberOfStops);arrow_forwardjava langarrow_forwardWhy the below class is showing compilation error? abstract class AbstractClass{abstract void abstractMethod(){System.out.println("First Method");}}arrow_forward
- Answer the follwoing question regading java:arrow_forwardThe following is in Java: public class MyClass { private int x; private double y; public static void setValues(int a, double b) { x = a; y = b; } } 1) What is the problem? 2) In a few sentences how can the issue be fixed?arrow_forwardDefine an Animal method that updates the time to complete a particular behavior based on its name. Choose one of the following from the above choices (A, B, C or D within the code): public class Animal { // Other instance variables, constructors and methods // omitted for brevity // A public void updateTimeTakenForBehavior(String behaviorName, int timeToComplete) { for(int i = 0; i < this.behaviorList.length; i++) { Behavior tempBehavior = this.behaviorList[i]; if( tempBehavior.getBehaviorName().equals(behaviorName)) { tempBehavior.setTimeToComplete(timeToComplete); } } } // B public void updateTimeTakenForBehavior(String behaviorName, int timeToComplete) { for(int i = 0; i < this.behaviorList.length; i++) { Behavior tempBehavior = this.behaviorList[i]; if( !tempBehavior.getBehaviorName().equals(behaviorName) ) {…arrow_forward
arrow_back_ios
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