5) Identify bugs in the following piece of code public final class Person{ public String name;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
5) Identify bugs in the following piece of code public final class Person{ public String name; private int age; publiz } abstract class Worker extends Person{ private static void main(String args[]) { x Worker w w.age } public void storeData() { try{ System.out.println("The name is "+name); 23; } File f = if(!f.can Write()) new Person("Ali"); new File("c:\\abc.txt"); throws new IOException(); catch(Exception e) { } catch(IOException f) { } 16 ally f.writeInt(23); FileOutputStream fos= new FileOutputStream(new ObjectOutputStream ("c:/a.txt")); fos.writeObject(this); (marks=6) kamp alist tat Page 2 of 2 5) Identify bugs in the following piece of code public final class Person{ public String name; private int age; publiz } abstract class Worker extends Person{ private static void main(String args[]) { x Worker w w.age } public void storeData() { try{ System.out.println("The name is "+name); 23; } File f = if(!f.can Write()) new Person("Ali"); new File("c:\\abc.txt"); throws new IOException(); catch(Exception e) { } catch(IOException f) { } 16 ally f.writeInt(23); FileOutputStream fos= new FileOutputStream(new ObjectOutputStream ("c:/a.txt")); fos.writeObject(this); (marks=6) kamp alist tat Page 2 of 2
Expert Answer:
Answer rating: 100% (QA)
ERROR 1 Error The main method in Worker class is declared as private Corrected The main method shoul... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
How do the Uniform Trade Secrets Act (UTSA) and the Economic Espionage Act of 1996 differ? Why don't these acts always provide a sufficient remedy for the theft of trade secrets?
-
A Rope with Mass In most problems in this book, the ropes, cords, or cables have so little mass compared to other objects in the problem that you can safely ignore their mass. But if the rope is the...
-
Duncan Company's year-end trial balance shows accounts receivable of $89,000, allowance for doubtful accounts of $500 (credit), and net credit sales of $270,000. uncollectibles are estimated to be...
-
On June 28, 1997, in Las Vegas, heavyweight boxers Mike Tyson and Evander Holyfield met for what proved to be a night to remember. During the third round of the fight, a desperate Tyson illegally bit...
-
Anne Cleves Company reported the following amounts in the stockholders equity section of its December 31, 2007, balance sheet. Preferred stock, 10%, $100 par (10,000 shares authorized, 2,000 shares...
-
7. In each of the following scenarios, a through d, determine whether the following is a microeconomic or macroeconomic issue and WHY. a. Dell computers announces that it will raise the price of its...
-
Poplar Outdoor Corporation owns 60 percent of the voting stock of Sugg Australia. Date-of-acquisition information is as follows: Acquisition cost: $59.25 million Fair value of the noncontrolling...
-
A construction company must transport materials from its storage facility to a job site. The table below provides information on the travel times, in minutes, between locations. The storage facility...
-
What is situational leadership? How can leaders use situational leadership in their daily activities to better their organization? How can Situational Leadership be used to develop employees...
-
This week will focus on situational leadership. Situational leadership is based on a leader's ability to adapt their style and approach based on what is most needed in that situation. What is most...
-
Summarize what Situational Leadership is. All four quadrants and what they mean. Give 3 example cases found that demonstrate situational leadership. Give 3 examples of how you demonstrated...
-
What are the best takeaways we can take from situational leadership. b) How can situational leadership help us in our workplace. c) How can we turn situational leadership into habits.
-
URSING PEER INTERVIEWS ASSIGNMENT INSTRUCTIONS OVERVIEW explore delegation policies as listed on the State Board of Nursing website for the state in which you hold your nursing license. You will also...
-
Assume on January 1, 2017, a wholly owned subsidiary sells to its parent, for a sale price of $132,000, equipment that originally cost $180,000. The subsidiary originally purchased the equipment on...
-
Find the reduced echelon form of each of the matrices given in Problems 120. c 1 26 + 4
-
Repeat any of the previous programming projects using a JavaFX graphical user interface. Previous programming projects Write a Java program that serves as a primitive web browser. For this assignment...
-
Write a program that will read a line of text that ends with a period, which serves as a sentinel value. Display all the letters that occur in the text, one per line and in alphabetical order, along...
-
Consider a class Characteristic that will be used in an online dating service to assess how compatible two people are. Its attributes are descriptiona string that identifies the characteristic...
-
Explain the relationship between the finite sample \(F\)-test and the large sample \(\chi^{2}\)-test, and the assumptions under which each is suitable.
-
Use the Akaike information or Schwartz criteria to select variables for a predictive model.
-
Identify influential observations in a multiple regression model.
Study smarter with the SolutionInn App