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
thumb_up100%
Assume B is a subclass of A. Which of the statements about the following assignment is false?
A a = new B();
We can assign anything to variable a that has a subtype of B.
We can call on a any method defined in A.
We can call on a any method defined in B.
We can assign anything to variable a that has a subtype of A.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
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
- For this exercise, you are given a Team superclass with a BaseballTeam and FootballTeam subclass. Take a moment to examine these classes and the instance variables and methods in each. In the TeamTester class, you will see three objects declared and instantiated using the Team, FootballTeam, or BaseballTeam classes. For each object, use a print statement to print out any public method that returns information that is available for that particular object, including the toString. For example, the dolphin object is a FootballTeam object. One of the pieces of information that can be printed is the getTies() method, so you will call that method in your TeamTester file: System.out.println(dolphins.getTies()); Do this for all the methods that each of the objects can call. Hint: Remember, for the program to compile and run, Java looks for methods to exist in certain classes. ================================= public class Team { private String name;private String location;private int…arrow_forward4. Is it possible to declare abstract methods as private?a. Justify your answer.arrow_forwardNeed help asap:arrow_forward
- Write a method for the farmer class that allows a farmer object to pet all cows on the farm. Do not use arrays.arrow_forward4. Write a class "machine" and "washing machine". Class "washing machine" should inherit from class "machine". Attributes of the machine will be: name, type, year. The washing machine should have the attributes: volume, depth, weight. In both classes should be method "show_attributes" which prints the attributes. Demonstrate in main function the usage of these classes.arrow_forwardQuestion 11 Lets say that class Laptop has been implemented. In order to compare two laptops a compareTo method that is in the comparable interface should be implemented. Which one of the following is the correct header for the method compareTo being added to the Laptop class 1. public static int compareTo(Object o) 2. public int compareTo(Laptop o) 3. public boolean compareTo(Object o) 4. public int compareTo(Object o) O 1 O 2 O 3arrow_forward
- Show code for an input method of a Time class. (A time-of-day has both an hour and a minute, commonly separated by a : symbol.) (Thought-provoker: Some times have a number of seconds after a 2nd : symbol...) (Hint: The members of a Time are not independent.)arrow_forwardWe have a parking office class for an object-oriented parking management system using java Add(implement) a method to the Parking Office class to return the collection of permit ids for a specific customer (getPermitIds(Customer)) using java I have attached two class diagrams with definitions of all related classes in our system (i.e car, customer, .....). N.B. Parking office methods in the class definition like register, getcustomer and addcharge have already been implemented, we just need an additional getPermitIds(Customer) method as mentioned above Explain your code in a few words Important- We have a method to return a collection of permit ids (getPermitIds), what we need is a method to return the collection of permit ids for a specific customer (getPermitIds(Customer))arrow_forwardAll vehicles used for transportation in the U.S. must have identification, which varies according to the type of vehicle. For example, all automobiles have a unique Vehicle Identification Number (VIN) assigned by the manufacturer, plus a license plate number assigend by the state in which the auto is registerd. Your task is to modify the Auto class below to override the equals method of the Vehicle class to test that the VIN and license plate number are identical.arrow_forward
- Write a class that tests and demonstrates that your Candidate and Electionclasses implement the specification given above. Note that this does not need to be a Junit test class.Your test class must illustrate all of the features that you have implemented. This will best be done by having at least one separate test method for each feature. For instance:• A method that creates a Candidate object and prints out the result of calling each of its accessor (get) methods; • A method that adds a vote to an existing Candidate object.• A method that creates an Election object, creates a few Candidateobjects and adds them to it, and then calls the printAll method;• A method that finds a matching Candidate;• A method that does not find a matching Candidate;• etc.Note that the list above is not a complete list of the test class’s methods and you will need to define more than those for this part. It will be worth writing this test class alongside writing the other classes. For instance, develop the…arrow_forwardMake a class Person, with instance variable name, age, and gender. Make a class Employee inheritfrom Person, with extra data for salary, and hiring date. Make another class Student inherit from Person,with data for program name, level (undergraduate/graduate), and program year. Supply required methods forthe superclass and the subclasses. Make a subclass Manager from Employee, with bonus salary, andoverride the corresponding method(s). Provide toString method for the Employee class and its subclass,Manager, such that it returns employee name, type of the employment, and salary. For instance if you createan object, manager1, from Manager class, with name=”John Smith” and annual salary of $125,000 and bonusweekly bonus of $200, and then write a print statement like System.out.println(manager1); , the output willbe:John Smith, Manager, Salary = $125,000/year, Weekly bonus = $200arrow_forwardI have a Programming Question, The following is a class definition for a simple Ebook. So i need to write a second constructor that takes a String array of pages as input and sets the String array instance variable equal to the input. Continue to default the current page number to zero. Part 2: Write a getter and a setter method for the page number variable. The setter should check to make sure that the input is a valid page number and only update the variable if the new value is valid. Part 3: Write a getCurrentPage method that returns the String of the current page indexed by current_page. Here below are the two instance variables and one parameterless constructor that were provided public class Ebook{ private String[] pages; private int current_page; //constructor public Ebook() { this.pages = {"See Spot.", "See Spot run.", "Run, Spot, run."}; this.current_page = 0; }}arrow_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