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...
-
The Raven Co. has just gone public. Under a firm commitment agreement, Raven received $17.67 for each of the 15 million shares sold. The initial offering price was $19 per share, and the stock rose...
-
Consider a European call and a European put with the same strike price and time to maturity. Show that they change in value by the same amount when the volatility increases from a level, , to a new...
-
ABC Inc. purchased all of the outstanding common shares of XYZ Inc. for \($100\) million cash. At the time of the acquisition, the fair value of XYZ was \($80\) million. Presented below are the...
-
Troutman Corporation has 7,000 shares of common stock outstanding. It declares a $1 per share cash dividend on November 1 to stockholders of record on December 1. The dividend is paid on December 31....
-
What is duration GAP? Is it a valid tool to manage the interest rate risk?
-
5 I . 1 2 im 4 5 5 7 B SCENARIO & REQUIREMENTS SCENARIO: You have invented the first maintenance-free jet wax called "Jetwax 100." Jetwax 100 can last up to 1 year on any plane surface. In order to...
-
add _ account: This functions takes 3 parameters: users _ passes, new _ username, and new _ password. It encrypts the new password ( using the encrypt _ decrypt function ) before concatenating the...
-
At what temperature will water boil at Lake Tahoe? Lake Tahoe isapproximately 1900 m above the sea level. The molar mass of air is29.0 g/mol. Assume that air pressure at sea level is 1.00 atm andthe...
-
Anita Mir started a business running a boutique clothing store on 1 January 2019. On that date she paid 25,000, which she had inherited from her grandma, into the business bank account and took out a...
-
Complete the following steps: Add a top-level docstring and a main block. (1) Create a function. The function name, argument, and return value are show in the animation below: Terminalizer...
-
Dr. Meredith Grey is a 76-year-old woman that presented to the outpatient clinic for reports of problems with attention/concentration (e.g., problems focusing for long periods and is easily...
-
Find the future value of $5000, at an annual percentage rate of 3.2%, compounded continuously, for 7 yr. [5.2] Business: present value. Find the present value of $10,000 due in 5 yr, at an interest...
-
Use the fileUN.txt that gives data about the 193 members of the United Nations with the countries listed in alphabetical order. Each line of the file gives the name, continent, population (in...
-
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?
-
When a consumer spends her income on goods and services in such a way that her utility is maximized, she reaches a. monetary equilibrium. b. market equilibrium. c. consumer equilibrium. d. marginal...
-
What is the connection between the law of demand and the law of diminishing marginal utility?
-
In consumer equilibrium, a. the marginal utility from consumption is the same across all goods. b. individuals seek the combination of goods that maximizes their satisfaction, given limited income....
Study smarter with the SolutionInn App