Question: 1-Object, which every Java class inherits from, is a(n) a.Class b.Java interface c.String 2-Suppose you are writing many tests for your class that represents a

1-Object, which every Java class inherits from, is a(n)

a.Class b.Java interface c.String

2-Suppose you are writing many tests for your class that represents a Werewolf. In your test case, you should

a.Only test static methods b.Create one Werewolf and use it in all your tests c.Create a new Werewolf for each test

3-Suppose your program converts from Celsius to Fahrenheit, but it crashes if the user enters the value 100 degrees C. The crash is caused by a:

a.Logic error b.Syntax error c.Runtime error d.Checked Exception

4-Suppose you are writing an application that will be used to operate a pig farm. If the number of instances of the class Pig ever exceeds 20, the farmer and her employees, who are healthy eaters, will eat one Pig per day until the number falls back to 10 or less. What is the best way to keep track of the number of Pigs in the application?

a.Use a static variable b.Instantiate the Pigs using an implicit constructor c.Save a list of the Pigs once per hour to a file using binary I/O, read the file back in, and count the length of the list after you run readObject() d.Use an instance variable e.Make the Pig class anonymous

5-Which of the following statements about binary file I/O is/are TRUE?

a.It allows an application to read and write entire objects to and from files b.It uses a plain text file format c.It requires casting objects when they are read from files d.It makes parsing code unnecessary e.It can't be used in an application that uses JavaFX

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!