aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics Question: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generics Question:" Watch "Generics Question:" New topic
Author

Generics Question:

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707


I prefer to choose a,c,d.

What do you "Java community people" say about my chosen options?

Source: Voodoo exam simulator!


Regards,
cmbhatt
[ April 21, 2007: Message edited by: Chandra Bhatt ]

cmbhatt
Arad Chear
Ranch Hand

Joined: Jan 05, 2007
Posts: 98
ummmmmmmm i'will back
[ April 21, 2007: Message edited by: Eisa Ayed ]
Arad Chear
Ranch Hand

Joined: Jan 05, 2007
Posts: 98
i find only two statement true !




classA {}
class B extends A {}
class C extends A {}
class D extends B {}
class E extends B{}

Which three statements are true?
a. The type List<A> is assignable to List.// yes

b. The type List<B> is assignable to List<A>. // must be same type

c. The type List<Object> is assignable to List<?>.// No
//List<Object> mean this list can hold only List<Object> not List<A> or List<B> or list of any thing List<?>

d. The type List<D> is assignable to List<? extends B>. // No
//List<D> cannot hold List<E>

e. The type List<? extends A> is assignable to List<A>.// yes
//List<? extends A> any List hold Objects from subclass of A can hold to List<A> which is superclass for them

f. The type List<Object> is assignable to any List reference. // No
// its like c
g. The type List<? extends B> is assignable to List<? extends A>.// No
// List<? extends B> cann't hold List<C>


Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Eisa,

You took options E,D,G wrongly.
Here I did some effort





Correct me!



Thanks,
cmbhatt
Louis Moloney
Ranch Hand

Joined: Feb 06, 2007
Posts: 59
i believe the correct answer is : a,c,d,g

f List<Object> is assignable to many refs but not all eg List<? extends B>



Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Moloney,


i believe the correct answer is : a,c,d,g


And you have strong believe! a,c,d,g are correct answers. (I say too)

But the source of question says only c,d,g are correct.


Regards,
cmbhatt
Louis Moloney
Ranch Hand

Joined: Feb 06, 2007
Posts: 59
excellent, looks like we must watch out occasional wrong answers on exam simulators.

I think generics are a very trciky topic, they diffiately confuse me sometimes !
[ April 22, 2007: Message edited by: Louis Moloney ]
Arad Chear
Ranch Hand

Joined: Jan 05, 2007
Posts: 98
actually i misunderstand the meaning of the sentence

maybe because i didn't speak very well in English Language ! ,

i thought it , like this :



Thanks Chandra
[ April 22, 2007: Message edited by: Eisa Ayed ]
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Very good Eisa,


I think you have got the soul of the generics, and specially
this kind of questions.

We should read the questions very carefully. Sometimes we know
the concept but due to the reason, we overlook the things, we go
wrong. It may happen with anybody.



Thanks Eisa for getting me close to the answer.




Thanks and Regards,
cmbhatt
Alam Ameghino
Ranch Hand

Joined: Jun 01, 2011
Posts: 60

Firt, sorry for me bad english, it is so bad.
For me it is wrong too.
Besides if the asigment are to rigth -> left, or left -> rigth, never there are 3 answer correct.



For me the question is wrong, in relation of the amount of answer correct.

I hope that someone can undertant me bad english! ;-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generics Question:
 
Similar Threads
Generics
SCJP 6 question
Generics Question
Generics
Generics