Indicate true or false for the following statements:
a. A protected datum or method can be accessed by any class in the same package.
b. A protected datum or method can be accessed by any class in different packages.
c. A protected datum or method can be accessed by its subclasses in any package.
d. A final class can have instances.
e. A final class can be extended.
f. A final method can be overridden.
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Introduction to Java Programming and Data Structures: Brief Version (11th Global Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Thermodynamics: An Engineering Approach
Modern Database Management
Introduction To Programming Using Visual Basic (11th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
- problem statement: Write a java classStringCheckto do the below given checks on accepted string or strings. Each function should be coded in separate methods of the class. Give appropriate instance variables to implement the method. The user should be able to enter the string through the main function in Main class. Use a constructor to initialize the String entered by the user. Use the Main class to test all the methods in StringCheckclass. The programs should have the below given checklist: 1)Define classStringCheck with required instance variables 2)The StringCheck class should have six methods to do the below functions: *Check if the user entered string is a simple sentence? (Starts with capital letter, Ends with period, space between words). *Check if the user entered string is a question? (Check if the string starts with ac apital letter ends with a question mark, space between words) *Check if the user entered string have numbers in it? *Check if string is a valid email *Check…arrow_forwardFor each statement, indicate if it is True or False by circling T or F. If you need to cross out an answer, be sure that your final answer is clear and unambigous-otherwise it will receive no credit. 1- An object of a derived class has access to the public methods of its base class T F 2- An object of a base class has access to the private helper methods of its derived class T F 3- Destructors are not inherited by derived classes T F T F T F u- An object of a derived class inherits the copy constructor of its base class 5- Operators are passed down inheritance hierarchies 6- Destructors in derived classes are called after their base class calls its destructor 7. Constructors of base classes are accessible by derived classes T T F Farrow_forwardsubject: object-oriented programming in your library there are two types of books. one category is literature books and the second category is generals. litrature books have the authorID, authorname literature theme language, publisher, volumn,, yearofpubication, journal have attributes volumn, issue, publisher,yearofpublication,journalID, technical sponser. design a parent class books extend two classes literaturebooks and journel from parent class make constructor , setter, and getterarrow_forward
- Answer with True or False for the following. Explain your answers.-It is legal to write a method in a class which overloads another method declared in the same.-It is legal to write a method in a superclass which overrides a method declared in a sub-class.arrow_forwardWrite In c++arrow_forwardC++ OOP use classes only...arrow_forward
- Create a C++ class and name it Vehicle. The class Vehicle has two constant private members: license and year. Write a constructor with two arguments. Make the Vehicle class an abstract class. Create another C++ class and call it Car. The Car class inherits form Vehicle class and has another private member (brand). Write a constructor with three arguments. Write a method that returns the following: My car is BMW (2020) with a license of ABC123. Write a C++ program. Create an instance of the Car class and display its members value and call its method. You are not allowed to use materials that are not covered in our lectures.arrow_forward10. Java automatically applies the method to an object referenced in a String expression to represent an object’s state. a. toString () b. abstract c. super() d. this() 11. The call in a class constructor invokes the superclass's constructor that has the corresponding argument list. a. tostring () b. abstract c. super() d. this() 12. The call to invokes the constructor for the current class whose parameter list matches the argument list. a. toString () b. abstract c. super() d. this() 13. If no constructors are defined for a class, the constructor for that class will be provided by default. a. private b. super c. public d. no-argument 14. What is a keyword to declare a subclass to a super class in Java? a. implements b. extends c. throws d. followsarrow_forwardUsing c++ Design a Wacky class that can be used to generate a message based on the information passed to it. The class should have a single integer private member variable: int num; Design the complete class so that if: an object is created with no parameters; num is initialized to 10. an object is created with 1 parameter that is an integer; num is initialized to the integer that is passed *2 an object is created with 1 parameter that is a double; num is initialized to the double *4 an object is created with 2 parameters, a char and a string; it prints the message "That's WACKY!"arrow_forward
- What is the main difference between a struct and a class? (More than 1 answer can be chosen)arrow_forwardWhat statements about the destructor of an object are accurate? a. The destructor of a class is a member function that is automatically activated when an object becomes inaccessible. b. The destructor has no arguments and its name must be the character ~ followed by the class name (e.g., ~bag for the bag class). c. Because the destructor is automatically called, programs rarely make explicit calls to the destructor, and we generally omit the destructor from the documentation that tells how to use the class. d. The primary responsibility of the destructor is simply releasing dynamic memory. c & d a, b, & c b & c a & b a, b, c, & darrow_forwardIf class A is a subclass of class B, then A has access to all of B's instance variables, including private ones. True Falsearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning