Consider the following code snippet: PrintWriter outputFile = new PrintWriter (f
ID: 3830697 • Letter: C
Question
Consider the following code snippet: PrintWriter outputFile = new PrintWriter (filename); writeData (outputFi1e); outputFile, close () How can the program ensure that the file will be closed if an exception occurs on the writeData call? Explain your answer. A Quiz class contains an array of Question objects. This is best described as an example of ...Explain. You are designing a software solution for an automobile rental company. You have decided that the following nouns apply to the requirements: Auto, Customer, Address, Rental Contract, Mileage, Rental Date, Daily Rate, Total. Which of these should be represented as classes? Explain your answer.Explanation / Answer
8)
// opening file
PrintWriter outputFile = null;
try {
outputFile = new PrintWriter(new File(filename));
writeData(outputFile);
} catch (FileNotFoundException e) {
e.printStackTrace();
}finally{
if(out != null)
out.close();
}
9)
Composition is fundamentally different from inheritance. When you use composition, you are (as the other answers note) making a "has-a" relationship between two objects, as opposed to the "is-a" relationship that you make when you use inheritance.
10)
Customer, Auto, Address Rental Contract can represent Class
These are the entity that can be indentified uniquely
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.