When a generic method is called,
A) the programmer must explicitly specify the actual types to use for the type parameters
B) the compiler determines the actual types to use for the type parameters from the context
C) the compiler uses information explicitly specified by the programmer, if available; otherwise, the type defaults to Object
D) None of the above
B) the compiler determines the actual types to use for the type parameters from the context
You might also like to view...
Which of the following statements will print a single line containing "hello there"?
a. System.out.println("hello"); System.out.println(" there"); b. System.out.println("hello" , " there"); c. System.out.println("hello"); System.out.print(" there"); d. System.out.print("hello"); System.out.println(" there");
Suppose that the price of an item is stored as an integer (number of cents) within a data member of a class. When the client wants to set the price, however, a setPrice function is called which passes a number in as dollars and cents (a float), then it is converted and stored as cents by the setPrice function. This is an example of:
A. a const function B. a const reference function C. an accessor function D. data translation
Choose the graphic format that is best-suited to display photographs on web pages.
a. jpg b. photo c.gif d. psd
Given a relational database with a person table that contains an id, name, and age. What do each of the following return?
1. Select * from person. 2. Select age from person. 3. Select id from person. 4. Select name, age from person. 5. Select * from person where age > 20. 6. Select name from person where age < 20.