Monday 28 January 2013

SCJP DUMPS 2012 2013 |OCJP DUMPS::Collections And Generics Q.1


OCJP DUMPS | SCJP DUMPS 2012 :
                 COLLECTIONS And GENERICS Dumps :

Question NO..1

Given:

import java.util.*;
public class Group extends HashSet<Person> {
public static void main(String[] args) {
Group g = new Group();
g.add(new Person("Hans"));
g.add(new Person("Lotte"));
g.add(new Person("Jane"));
g.add(new Person("Hans"));
g.add(new Person("Jane"));
System.out.println("Total: " + g.size());
}
public boolean add(Object o) {
System.out.println("Adding: " + o);
return super.add(o);
}}
class Person {
private final String name;
public Person(String name) { this.name = name; }
public String toString() { return name; }
}
Which of the following occur at least once when the code is compiled and run?
(Choose all that apply.)
A. Adding Hans
C. Adding Jane
E. Total: 5
B. Adding Lotte
D. Total: 3
F. The code does not compile.
G. An exception is thrown at runtime.



   Check Answer:              F

F is correct. The problem here is in Group's add() method—it should have been
add(Person), since the class extends HashSet<Person>. So this doesn't compile.
Pop Quiz: What would happen if you fixed this code, changing add(Object) to
add(Person)? Try running the code to see if the results match what you thought.
-> A, B, C, D, E, and G are incorrect based on the above.



Related Questions::

1. Scjp Ocjp dumps 2012: Question no 1.
2. Scjp Ocjp Dumps : Question no. 2
3 .SCJP certification dumps |Ocjp dumps| Ocjp 1.6 dumps.

Friday 11 January 2013

Java Softwares :Free Download Latest JAVA SE JDK 7u10,Software Review

Free Download Latest JAVA SE JDK 7 Software :

         This is the latest java software of JDK 7 version with the new update 10.
      
This releases brings in key security features and bug fixes.  Oracle strongly recommends that all Java SE 7 users upgrade to this release. JavaFX 2.2.4 is now bundled with the JDK on Windows, Mac and Linux x86/x64.

for free download your can click below ....


         Click here to  Download Now