Write a Java Program to do the following. a) Create a class Teacher with the field...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java Program to do the following. a) Create a class Teacher with the field collegeName type String, designation Type String and a method work(). b) Create a sub class Physics Teacher of Teacher. Which have single field mainSubject of type String and main method. c) Create an object "obj" of PhysicsTeacher inside class Physics Teacher. Show, how we can call field collegeName, designation and method work() using object "obj". Q.2 Assume that you see the following lines of code: (Marks:2) Device dev = new Printer(); dev.getName(); a) Printer is a subclass of Device, which of these classes must have a definition of method getName for this code to compile? b) if both classes have an implementation of getName, which one will be executed? Write a Java Program to do the following. a) Create a class Teacher with the field collegeName type String, designation Type String and a method work(). b) Create a sub class Physics Teacher of Teacher. Which have single field mainSubject of type String and main method. c) Create an object "obj" of PhysicsTeacher inside class Physics Teacher. Show, how we can call field collegeName, designation and method work() using object "obj". Q.2 Assume that you see the following lines of code: (Marks:2) Device dev = new Printer(); dev.getName(); a) Printer is a subclass of Device, which of these classes must have a definition of method getName for this code to compile? b) if both classes have an implementation of getName, which one will be executed?
Expert Answer:
Answer rating: 100% (QA)
Sure heres a Java program that satisfies the given requirements Teacher class class Teacher String c... View the full answer
Related Book For
An Introduction to Measure Theoretic Probability
ISBN: 978-0128000427
2nd edition
Authors: George G. Roussas
Posted Date:
Students also viewed these computer network questions
-
For n ( 1, let fn be real-valued measurable functions defined on (, and suppose that |fn (x)| ( M ( for x ( (. Then for any sequence {xn} with it holds ( 0 a.e. [(], where ( is the Lebesgue measure? ...
-
For n > 0 let Fn denote the nth Fibonacci number. Prove that Fo + Fi + F2 +. + F, =F = Fa42 - 1. 1=0
-
For n ¥1, let F n and F be d.f.s of r.v.s let f n be real-valued measurable functions defined on be continuous, and let g : R [0, ] be continuous, Assume that: (i) F n F as n . (ii) (iii)...
-
Consider an investor's choice of a farm unit in the Corn Belt, one in the California Central Valley, or the one in the Great Plains region. An investor added these three assets in one portfolio. The...
-
Petty Petroleum, Inc., uses various chemicals to manufacture its products. Variance data for last month for the three primary chemicals used in production are shown below (F indicates a favorable...
-
Alberta Company had the following account balances on December 31, 2022. Instructions Prepare the liability and stockholders equity section of a classified balance sheet in good form as of December...
-
Consider a GB2 probability density function given in equation (17.3). a. Reparameterize the distribution by defining the new parameter \(\theta=e^{\mu}\). Show that the density can be expressed as...
-
Zimmerman Companys annual accounting year ends on December 31. It is December 31, 2014, and all of the 2014 entries except the following adjusting entries have been made: a. On September 1, 2014,...
-
Miguel is an accounting manager for Bronx Shoes Company. In designing the coding scheme for the companys accounting system, Miguel is considering assigning numbers A10 through A99 for all asset...
-
Examine the following summary of the U.S. balance of payments for 2000 (in $ billion) and fill in the blankentries. Debits 1,418.64 774.86 352.90 - 1,809.18 Balance on current account 3 securities...
-
Haulton Dog Care Co wants to finance a new animal shelter by making ten annual deposits into a fund earning 9% compounded annually. The first five deposits are to be 517.000 each and will be paid at...
-
Consider the circle shown in the figure. y (m) 11 10 9 8 7 6 5 4 3 2 1 0 5 x (m) What is the diameter of the circle? Please, notice that the circle passes through a number of grid intersection...
-
According to the projectile motion model, which statement below best describes vo? Choose the best description below. OA. The expression vo represents the velocity of an object launched, thrown, or...
-
In a physics experiment, scientists use the equation R = to represent the resistance in a conductive wire. Rewrite this formula to represent the length of the wire in terms of R, p, and A where p...
-
The Mars Rover, was sent to the red planet and has been sending back pictures to the earth, has a mass of 225 kg. We know that the planet Mars has a gravitational (g) field strength at its surface of...
-
Figure (a) below shows a U-shaped tube containing an amount of mercury. The left arm of the tube has cross-sectional area A of 10.3 cm, and the right arm has a cross-sectional area A of 5.40 cm. In...
-
Hexanes are used as solvents for things like oil-based paint. Balance the reaction for the combustion of hexane. The unbalanced reaction is: 2C6H4(l) + 190(g) 12C0(g) + 14H0 (1) 80.0g NH3 and 195.0g...
-
Evaluate the integral, if it exists. Jo y(y + 1) dy
-
(i) Let Ai ( (i, i = 1, 2,..., n, and set E = A1 ... An. Then E = ( if and only if at least one of Ai, i = 1, 2, ..., n, is = (. (ii) If also Bi ( (i, i = 1, 2, ..., n, and F = B1 ... Bn. Then...
-
In reference to the proof of Theorem 2, show that limt0 g(t) = b - a as claimed there.
-
For a r.v. X with X = ( ( and Var (X) = (2 = 0, show that P (X = ) = 1?
-
Explain the role of parameters and return values in exchanging messages.
-
Describe events. Provide an example.
-
What are the building blocks of a collaboration diagram?
Study smarter with the SolutionInn App