Candidat | Session |
ID : 148 Adresse mail : Téléphone : Diplôme : Ecole/Université : Année d\'expérience : 0 Votre commentaire : Commentaire candidat: ceci est un exemple de rapport!. |
ID session : 5mag Début : 2016-08-06 14:14:29 Fin : 2016-08-06 14:41:09 |
david petit
|
Score Global 9 / 13 |
1. [JAVA] Java core (JSE)
1-1. Détails QCM
Question | Candidat answer | Correct answer | Marks |
---|---|---|---|
Question 1 "public class Test implements Device { public void doIt() { }} abstract class Phone1 extends Test { } abstract class Phone2 extends Test { public void doIt(int x) { } } class Phone3 extends Test implements Device { public void doStuff() { } } interface Device { public void doIt(); }Que se passe t'il au moment de la compilation de ce code?": | compilation sans erreur | compilation sans erreur | 1 |
Question 2 "class Top { public Top(String s) { System.out.print("B"); } } public class Test extends Top { public Test(String s) { System.out.print("D"); } public static void main(String[] args) { new Test("C"); } }Qu'affiche ce programme?": | BD | ne compile pas | 0 |
Question 3 "class Top { protected final void flipper() { System.out.println("Top"); } } public class Test extends Top { public final void flipper() { System.out.println("Test"); } public static void main(String[] args) { new Top().flipper(); } }Qu'affiche ce programme?": | skiped this question | ne compile pas | 0 |
Question 4 "class Dog { public void bark() { System.out.print("woof "); } } class Hound extends Dog { public void sniff() { System.out.print("sniff "); } public void bark() { System.out.print("howl "); } } public class DogShow { public static void main(String[] args) { new DogShow().go(); } void go() { new Hound().bark(); ((Dog) new Hound()).bark(); ((Dog) new Hound()).sniff(); } }Qu'affiche ce programme?": | ne compile pas | ne compile pas | 1 |
Question 5 "class Alpha { static String s = " "; protected Alpha() { s += "alpha "; } } class SubAlpha extends Alpha { private SubAlpha() { s += "sub "; } } public class SubSubAlpha extends Alpha { private SubSubAlpha() { s += "subsub "; } public static void main(String[] args) { new SubSubAlpha(); System.out.println(s); } }}Qu'affiche ce programme?": | alpha subsub | alpha subsub | 1 |
Question 6 "class Beta { } class Alpha { static Beta b1; Beta b2; } public class Tester { public static void main(String[] args) { Beta b1 = new Beta(); Beta b2 = new Beta(); Alpha a1 = new Alpha(); Alpha a2 = new Alpha(); a1.b1 = b1; a1.b2 = b1; a2.b2 = b2; a1 = null; b1 = null; b2 = null; // do stuff } }Au niveau de do stuff combien d'objets sont éligibles au Gargage Collector? ": | 2 | 1 | 0 |
Question 7 "public class Ebb { static int x = 7; public static void main(String[] args) { String s = ""; for (int y = 0; y < 3; y++) { x++; switch (x) { case 8: s += "8 "; case 9: s += "9 "; case 10: { s += "10 "; break; } default: s += "d "; case 13: s += "13 "; } } System.out.println(s); } }Qu'affiche ce programme?": | skiped this question | 8 9 10 9 10 10 | 0 |
Question 8 "import java.util.*; public class MapEQ { public static void main(String[] args) { MapQu'affiche ce programme?": | 2 | 2 | 1 |
2. [JAVA] Optimisation de distance
2-1. Sujet coding Optimisation de distance
|
2-2. Unit test cases
Main File: Distance.java import java.util.Vector; public class Distance { public static int getMindistance(Vector<Integer> rues) { // votre code ici int dist = 0; Vector<Integer> list_dist = new Vector<Integer>(); for (int i = 0; i < rues.size(); i++) { dist = 0; for (int j = 0; j < rues.size(); j++) dist += Math.abs(rues.get(i) - rues.get(j)); list_dist.add(dist); } int res = list_dist.get(0); for (int d : list_dist) { if (res > d) res = d; } return res; } } |