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
Concept explainers
Question
What is the accessibility of a protected attribute that is in a public class?
A. Any class has access to this attribute.
B. Only the class and its subclasses have access to this attribute.
C. Only the class itself has access to this attribute.
D. Any class in the same package has access to this attribute.
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
- Which of the following statements are true? Group of answer choices 1. A superclass reimplements the functionality of its subclasses. 2. A class that implements an interface reuses the functionality of the interface. 3. A derived class reuses the functionality instead of reimplements it. 4. If a class has no bugs, we can inherit from it without fear of having any bugs in our class.arrow_forwardIsn't it better to just put this data into the instance of the currently active class? If not, why not?arrow_forward1.A system offers four service classes A, B, C and D, which differ in price tag and have a distinctive public method doA(), doB(), doC(), and doD(), respectively. These classes do share an identical public feature doCommon() method. The price attribute is private and is declared only once somewhere to be shared by all service classes. To use the system, a selected service is first paid for and the corresponding object is created to run the distinctive method and then the doCommon() method. Show the UML class diagram for the system. Extra interfaces, classes or methods can be added if needed 2.Today, the distinctive methods are changed to a private visibility. This however limits a created object to call its own method. Redesign the system to solve the problem by calling a public method doJob() and utilizing polymorphism and dynamic binding to provide the distinctive service for a selected class. Extra interfaces, classes or methods can be added if needed. 3. Show only the program…arrow_forward
- Create an Employee class using JAVA with the following attributes: id, firstName, lastName, department, position Add the following behaviors: 1. A non-parameterized constructor. 2. A parameterized constructor. 3. setters and getters for each field. 4. void printDetails() that prints details of an employee using the getters. In the main(), perform the following: 1. Create an Employee object using the non-parameterized constructor. Use the setters to assign values to the fields 2. Create an Employee object using the parameterized constructor. 3. Print the details of the two objectsarrow_forwardWhen should you use an abstract class? Group of answer choices 1. All options are correct. 2. When two or more classes will share identical methods, so that they can be moved into the abstract class. 3. When you want to make an object that is not concrete, and instead is more of an idea. 4. When you have classes that will share method names, but can have different implementations. 5. There is no need for abstract classes. Instead, interfaces are a better programming choice.arrow_forwardWhile we discussed the steps to define an interface for a class, we mentioned that that a class interface typically contains only methods and publicly accessible data fields generally cause problems. 1. Explain why this practice causes problems? 2. Explain two reasons for your statement.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