4. Supposed you would like to override a method with a default modifier in the superclass, which modifier/s can be used? (select all that apply) public private default protected None of the above 5. When a method is abstract in the superclass, its non-abstract subclass needs to override that method? a) True b) False 6. Can you override a method that has the keyword "abstract" in the method declaration? a) Yes b) No оооо
Q: What is the purpose of the operating system on a computer? Identify several activities that this…
A: Introduction: Malware is a kind of harmful software that cyber criminals use to corrupt computer…
Q: Computer science What is the objective and major use of the GROUPING SETS subclause?
A: Introduction What is the objective and major use of the GROUPING SETS subclause?
Q: Write a program in html to link a text at the top of a page to another part of the same page.
A: Introduction: Here we are required to write a program in HTML that will link a text at the top of a…
Q: Discuss applicable technology succinctly and succinctly. Determine which piece of relevant…
A: To begin, one must understand what constitutes proper technology: To begin, it is necessary to…
Q: Since application are often develop independently in file processing systems, unplanned data files…
A: The question is to choose the correct option for the given question.
Q: Write c program to get two int numbers from users and print absolute difference between two numbers
A: HI THEREI AM ADDING ANSWER BELOWPLEASE GO TROUGH IT THANK YOU
Q: Where can I find the criteria for selecting a node to serve as a supernode in a peer to peer…
A: A super-peer is a peer-to-peer (P2P) network node that acts as a server for both a customer network…
Q: A table called "game1" contains three columns and twenty rows, but "game2" has the same column as…
A: A table is a collection of related data recorded in a table format in a database. In relational and…
Q: In SQL, what numeric data formats are available?
A: Tip Numeric data types are used to store numbers in database tables. Typically, these data formats…
Q: The n'h Fibonacci Number can be calculated using the following formula: و « 1+ v5 V5 1- V5 -)") 2 1…
A: Divide the formula in three parts: part1 = ((1+5)/2)n part2 = ((1-5)/2)n part3 = (part1 - part2)/5…
Q: PYTHON CODING Find the Closest Point to the starting point We want to use the formula below to…
A: Try to iterate a for loop in each point of the remaining points list. Find the distance between the…
Q: What is the definition of the Candidate key?
A: In this question we will understand about the candidate key in the database table. Let's discuss
Q: Follow the indicated operation in order to know the number system used for the answer. NO need to…
A: The answer is given in following figure.
Q: The ARM and core i3 architectures are very different.
A: Introduction: The type of instruction that each device understands is the primary distinction…
Q: As a computer scientist, how would you define magnitude?
A: The representation of a number's magnitude (decimal) in computer science is referred to as the…
Q: What type of main memory and cache memory should you be looking for is up to you.
A: Foundation: The device with the greatest amount of main and cache memory should be chosen. If the…
Q: Explain multimedia in your own words.
A: Definition:- Multimedia, as the name implies, is a collection of several sorts of media such as…
Q: The distinctions between polymorphic functions in ML and generic functions in ADA are as follows:
A: Polymorphism: Polymorphism is a mechanism that allows an operator (or a member function name) to…
Q: What is the difference between a union and a Cartesian product?
A: Cartesian product: Natural connects are based on matching qualities, which implies that the values…
Q: What is the best way to discuss the features of a monitor?
A: Introduction: Generally speaking, a monitor is an electrical visual computer display that consists…
Q: Define the heuristic known as the nearest neighbor (NN).
A: Introduction Define the heuristic known as the nearest neighbor (NN).
Q: Fill up the blanks with all numeric data types. Do you know how to use SQL?
A: Introduction: Given that SQL enables you to compare character values, it is possible to claim that…
Q: As seen in this Pascal's Triangle: 1 1 1 1 1 1 3 3 1 1 4 6. 4 1 Each row begins and ends with 1.…
A: Program is given below: import java.io.*; class PascleTriangle { public int factorial(int i) {…
Q: What are the most common loT device deployment integration challenges? How would you describe the…
A: Introduction: Challenges1) Compatibility and interoperability of various IoT systems:According to…
Q: t process model did you choose if we have only two developers and the deadline is only six
A: Lets see the solution.
Q: u consider using arrays in your program? Explain why you should impl
A: for example if you want to store roll numbers of 2 students in a class, you can simply use variable…
Q: What Exactly Is an Application Program?
A: Introduction: PROGRAM A programme consists of a set of instructions.It is a minor component of…
Q: Why aren't simple file systems utilised for data processing nowadays?
A: Introduction: There are various disadvantages of using file systems. That is why we now prefer DBMS…
Q: What is the difference between a main key and a candidate key?
A: Foundation: Candidate keys are selected to uniquely identify tuples in a database, and the primary…
Q: Discuss the social and ethical issues of integrating and utilising information technology in…
A: Introduction: The social and ethical implications of utilizing and implementing information…
Q: Write a program in C++ that allows a player to play Rock, Paper, Scissors. In this version, if there…
A: Coded using C++.
Q: as an analyst list ten bullet pionts on how to validate an authentic email
A: The above question that is ten points to validate an authentic email is answered below step
Q: Task - 1 Let's Play with Numbers!!! Write the ComplexNumber class so that the following code…
A: 1) Below is python program to include ComplexNumber class to generate the output It defines Real…
Q: What is the difference between hashing passwords saved in a file and savin them in a password…
A: Introduction: In this question, we're asked to identify the probable differences between employing a…
Q: of windows from different window systems.conside
A: Below the Window class must span the functionality of windows from different window systems.consider…
Q: What is Cognitive in HCI? Provide a example.
A: cognitive system learn and connect normally with people to expand what either people or machine…
Q: In what situations might the union operation of two tables be used?
A: Union operation is used to combine two tables which contains values present in the both tables. To…
Q: In an arithmetic equation with nested parentheses, which pair of parentheses is evaluated first?
A: Introduction: When parentheses are nested, the most extensive arrangement of parentheses is…
Q: verage 1 ment to see how many scores you need to include. (Keep ½. Create the chart for the…
A: Answer is in given below:-
Q: PYTHON A photographer is organizing a photo collection about the national parks in the US and would…
A: 1. open and read file 2.split each line of file by "_" 3. change the second part of each line which…
Q: Explain what a Card cage is: it is a structure in which circuit boards can be attached.
A: Commencement: An operating system is a piece of software that, among other things, manages…
Q: What does the term "alternate key" mean?
A: TIP : The Relational database design is incomplete without keys. They're used to define and…
Q: Compare and contrast the benefits and drawbacks of putting thin clients in a university computer lab…
A: Thin client is the stripped down version of a desktop terminal with no other resources attached to…
Q: A set of data items is normally distributed with a mean of 210 and a standard deviation of…
A: Your answer is given below in detail. Introduction :- It's z-score is the distance a data point is…
Q: Describe the security model used by the CNSS.
A: Introduction: John McCumber developed the CNSS security paradigm. It is a three-dimensional model…
Q: Write the corresponding productions to the following context-free grammar G = *((S), (a, b}, S, P)…
A: We need to write the productions for the given parse tree.
Q: Discuss source data automation (SDA) briefly, highlighting at least two (2) advantages of using this…
A: Automation of Source Data: SDA stands for source data automation, which is the process of acquiring…
Q: Is a wired network superior to a wireless network?
A: Introduction: The most significant factor in data transit between nodes is speed, which aids in…
Q: How do you create a threat model?
A: It is a methodical approach to identifying and analysing all hazards and security risks connected…
Q: 'Student1' has four columns and ten rows, while'student2' has five columns and seven rows. What is…
A: Tip: A table is a collection of linked data that has been organized in a table form and recorded in…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Please answer all the questions.
Step by step
Solved in 3 steps
- 1- Create a class SchoolKid that is the base class for children ar aschool . It should have attributes of the child’s name and age ,the name of the child’s teacher ,and the greeting. It should haveappropriate accessor and mutator methods for each of the attributes. Derive a class ExaggeratingKid from schoolkid , as described above . The new class should override the accessor method for the age , reporting the actual plus 2. It also should override the accessor for the greeting ,returning the child’s greeting concatenated with the words “I am the best”.What is the concept of binding? Differentiate between early binding and late binding. (Write in maximum 5 lines) Write a Java operator/keyword, which can be used to check the validity of reference before attempting down-casting from superclass object to subclass reference. Given an example of it usage. (Write in maximum 5 lines)Assume you have a method expecting the superclass's object to be passed as an argument. In this case, if you give it an object of subclass rather than superclass. Is it acceptable? Why or why not? (Write in maximum 5 lines)
- An employee has a name, phone number and salary. A coach is a person with a senitority status, one of: junior, lead, and senior. Define the possible status values as constants. A staff is a person with a job title and job descrption. Your programming task is to Implement as abstract class named Employee and two subclass name Coach and Staff in Java as defined above Provide constructors for classes to initalize private variable Override the toString() method in each of the classes in task 1 to display the class name and the person's name Write an application to create objects of type Coach and Staff and print the person's name and the class name of the objectsa. What is the concept of binding? Differentiate between early binding and late binding. (Write inmaximum 5 lines) [5 Marks]b. Write a Java operator/keyword, which can be used to check the validity of reference before attemptingdown-casting from superclass object to subclass reference. Given an example of it usage. (Write inmaximum 5 lines)Write a class named Vehicle with vehicleType, manufactureYear(int) and cost(double) as private data fields. [Hint: VehcleType could be "truck", "4WD", "Bus"] . Add a constructor with any two parameters of the superclass. Write a class named Car which inherits the Vehicle class. Add a non-static private string variable called companyName. Add a constructor in the subclass and a toString() method that prints the Car's data fields in the order VehicleType, manufactureYear, companyName [Hint: Add a toString( ) method in the superclass as well]. Create objects of Vehicle and Car class. Can the object of Vehicle class be stored in an object of Car Class? If yes, write the code. If No, Explain why? ***Student Instruction *** You need to write the complete code as mentioned below: i) The main class with necessary codes. ii) The subclass with necessary codes.iii) The Test class with necessary codes.
- Write a Java operator/keyword, which can be used to check the validity of reference before attempting down-casting from superclass object to subclass reference. Given an example of it usage. (Write in maximum 5 lines) Assume you have a method expecting the superclass's object to be passed as an argument. In this case, if you give it an object of subclass rather than superclass. Is it acceptable? Why or why not? (Write in maximum 5 lines)Create a base class with two methods. In the first method, call thesecond method. Inherit a class and override the second method.Create an object of the derived class, upcast it to the base type, andcall the first method. Explain what happens.1) In Java, you can use the ____ keyword to indicate that a class should inherit from another class 2) Which of the following statements is true about method overloading in Java? A subclass can overload a method of its superclass. A subclass cannot overload a method of its superclass. None A subclass must overload all methods of its superclass. 3) Which of the following statements is true about method overriding in Java? None A subclass can override a private method of its superclass. A subclass can override a static method of its superclass. A subclass must override all methods of its superclass. 4) True or False Inheritance allows a subclass to inherit properties and methods from a superclass 5) True or False A class can implement multiple interfaces. 6) What is the syntax for extending a class in Java? class Superclass extends Subclass class Subclass extends Superclass None class Subclass implements Superclass 7) Which of the following is an example of inheritance in Java? A class…
- Create a base class with an abstract print( ) method that is overridden in a derived class. The overridden version of the method prints the value of an int variable defined in the derived class. At the point of definition of this variable, give it a nonzero value. In the base-class constructor, call this method. In main( ), create an object of the derived type, and then call its print( ) method. Explain the results. (JAVA)Create a class Animal and Add a protected data member named id of integer type. Add get/set methods for id data member in Animal class with public access. Also provide default constructor this should initialize id to 0. Also provide parameterized constructor and toString method. Add an abstract method tellAboutSelf method to Animal class with public access Add another abstract method speak method to Animal class. Reptile, Bird, Mammal Next create the three child classes which extends form Animal class. Add a default constructor to each of the above created class. The constructor should initialize the id data member id, Reptile, Bird and Mammal, to 1, 2 and 3 respectively also it display a message “(class Name)’s default constructor”. E.g. for Bird it says “Bird’s default constructor”. Add a parameterized constructor to each of the above created class. The constructor should initialize the id data member, Reptile, Bird and Mammal, to the specified id passed to the constructor also it…Please someone help me how can i use java to create an abstract class called Worker and 2 subclasses HourlyWorker with monthlybasic salary and allowance and SalariedWorker pay rate and hour worked. Every worker has a name (use the Name class provided) and the year joined. Declare the data fields in the abstract class as protected. For each class, You only need to provide a parameterized constructor and implement the toString method. You may omit the set and get methods for each class.Both the HourlyWorker and SalariedWorker classes are required to provide anoperation to calculate the worker’s monthly salary.-The salaried worker is paid a monthly basic salary + allowance.-An hourly worker is paid payRate * hoursWorked