Log In Register

Units


Wildcards - Questions and Answers

 

Practice these Wildcards under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Wildcards for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Wildcards of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically Wildcards.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Wildcards under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Wildcards topic of Java Programming:

 

1. Which of these keywords is used to upper bound a wildcard?

Answer: Option C

Explanation:

2.  What is use of wildcards?

Answer: Option A

Explanation:
The wildcard can be used in a variety of situations: as the type of a parameter, field, or local variable; sometimes as a return type (though it is better programming practice to be more specific). The wildcard is never used as a type argument for a generic method invocation, a generic class instance creation, or a supertype.

3. Which of these is wildcard symbol?

Answer: Option A

Explanation:
 In generic code, the question mark (?), called the wildcard, represents an unknown type.

4.  Which of these is an correct way making a list that is upper bounded by class Number?

Answer: Option A

Explanation:

5. Which of the following keywords are used for lower bounding a wild card?

Answer: Option B

Explanation:
A lower bounded wildcard is expressed using the wildcard character (‘?’), following by the super keyword, followed by its lower bound: