OCP Oracle Certified Professional Java SE 11 Developer Practice Tests. Jeanne Boyarsky

Читать онлайн книгу.

OCP Oracle Certified Professional Java SE 11 Developer Practice Tests - Jeanne Boyarsky


Скачать книгу
9, 10][1, 10, 9][9, 1, 10][9, 10, 1][10, 1, 9][10, 9, 1]

      77 Which is the first line to prevent this code from compiling and running without error?char[][] ticTacToe = new char[3][3]; // r1 ticTacToe[0][0] = 'X'; // r2 ticTacToe[1][1] = 'X'; ticTacToe[2][2] = 'X'; System.out.println(ticTacToe.length + " in a row!"); // r3Line r1Line r2Line r3None of the above

      78 What is true of the following code? (Choose three.)36: var names = new HashMap<String, String>(); 37: names.put("peter", "pan"); 38: names.put("wendy", "darling"); 39: 40: String w = names.getOrDefault("peter"); 41: String x = names.getOrDefault("peter", "x"); 42: String y = names.getOrDefault("john", "x");One line does not compile.Two lines do not compile.If any lines that do not compile are removed, the String on line 40 is set to null.If any lines that do not compile are removed, the String on line 41 is set to "pan".If any lines that do not compile are removed, the String on line 41 is set to "x".If any lines that do not compile are removed, the String on line 42 is set to "x".

      79 What does the following output?18: List<String> list = List.of( 19: "Mary", "had", "a", "little", "lamb"); 20: Set<String> set = new HashSet<>(list); 21: set.addAll(list); 22: for(String sheep : set) 23: if (sheep.length()> 1) 24: set.remove(sheep); 25: System.out.println(set);[a, lamb, had, Mary, little][a][a, a]The code does not compile.The code throws an exception at runtime.

      80 Which of the following fills in the blank so this code compiles?public static void getExceptions(Collection<__________> coll) { coll.add(new RuntimeException()); coll.add(new Exception()); }?? extends Exception? super ExceptionNone of the above

      Конец ознакомительного фрагмента.

      Текст предоставлен ООО «ЛитРес».

      Прочитайте эту книгу целиком, купив полную легальную версию на ЛитРес.

      Безопасно оплатить книгу можно банковской картой Visa, MasterCard, Maestro, со счета мобильного телефона, с платежного терминала, в салоне МТС или Связной, через PayPal, WebMoney, Яндекс.Деньги, QIWI Кошелек, бонусными картами или другим удобным Вам способом.

/9j/4AAQSkZJRgABAQEBLAEsAAD/7SdOUGhvd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TGVmdGxvbmcAAAAAAAAADWNy b3BSZWN0UmlnaHRsb25nAAAAAAAAAAtjcm9wUmVjdFRvcGxvbmcAAAAAADhCSU0D7QAAAAAAEAEs AAAAAQACASwAAAABAAI4QklNBCYAAAAAAA4AAAAAAAAAAAAAP4AAADhCSU0EDQAAAAAABAAAAB44 QklNBBkAAAAAAAQAAAAeOEJJTQPzAAAAAAAJAAAAAAAAAAABADhCSU0nEAAAAAAACgABAAAAAAAA AAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEAL2ZmAAEAoZmaAAYAAAAAAAEAMgAAAAEA WgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklNA/gAAAAAAHAAAP////////////////// //////////8D6AAAAAD/////////////////////////////A+gAAAAA//////////////////// /////////wPoAAAAAP////////////////////////////8D6AAAOEJJTQQIAAAAAAAQAAAAAQAA AkAAAAJAAAAAADhCSU0EHgAAAAAABAAAAAA4QklNBBoAAAAAA08AAAAGAAAAAAAAAAAAAArXAAAI pQAAAA0AOQA3ADgAMQAxADEAOQA2ADkANgAxADMAMQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAA AAAAAAAAAAAIpQAACtcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAA AAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAABAAAAAAAAUmN0MQAAAA

Скачать книгу