MAD Mobile Application development chapter 3
Design patterns are just another name for best practices.
True or False?
False
In C#, Java, and Objective-C, what is the greatest number of subclasses a class can have?
More than 1
C#, Java, and Objective-C have automatic garbage collection enabled by default.
True or False ?
False
Which is not a possible outcome of an app with a memory leak?
The app will close itself automatically when it reaches the memory limit.
Given the inheritance tree in the accompanying figure, which is a list of all subclasses?
UnpoweredVehicle, PoweredVehicle, Bicycle, Skateboard, Motorcycle, Car
MVC stands for Model-View-Controller, a design pattern that separates program tasks into different tiers.
True or False?
True
Given the UML class diagram seen in the accompanying figure, what is the class's name?
Rectangle
What are the more commonly used names for accessor methods?
Getters and setters
Given the UML class diagram seen in the accompanying figure, what is/are the class's data member(s)?
length and width
Best practices are the result of finding the most successful set of test runs for an application.
True or False?
False
What term is used to identify when an object hands off some functionality to another object?
Delegate
Like object-oriented programs, procedural programs are data centered.
True or False?
False
In C#, Java, and Objective-C, String objects are immutable, meaning that after strings are created, they can't be changed. Therefore, the following code is illegal:
String str1 = "abc";
str1 = str1 + "123";
True or False?
False
The Java programming language is considered what type of language?
Object-oriented (OO)
Which of the following is NOT an example of a best practice?
Using inheritance
A child class can inherit the methods from its parent class (or super class).
True or False?
True
Which of the following is NOT the best example of encapsulation?
A main function doing error-checking before setting a Rectangle's instance variables' values.
Given the UML class diagram seen in the accompanying figure, what is/are the class's member method(s)?
getArea and getPerimeter
Which is the most efficient way to concatenate the two strings, "quick brown fox" and "jumped over the lazy dog" in Java?
StringBuffer buffer = new StringBuffer("quick brown fox");
buffer.append(" jumped over the lazy dog");
String string1 = buffer.toString();
Given the inheritance tree in the accompanying figure, which is a list of all superclasses?
Vehicle, UnpoweredVehicle, PoweredVehicle
Given the UML class diagram seen in the accompanying figure, what is/are the class's data member(s)?
Length and width
Which is the most efficient way to concatenate the two strings, "quick brown fox" and "jumped over the lazy dog" in Java?
StringBuffer buffer = new StringBuffer("quick brown fox");
buffer.append(" jumped over the lazy dog");
String string1 = buffer.toString();