В свежем номере JavaMagazine интересная подборка вопросов тестов из Oracle Certified Java SE 8 Programmer :

The purpose of this certification is to enable beginners to demonstrate their knowledge of fundamental Java concepts. The certification is designed for beginners in programming and/or those with a nonprogramming background who have basic mathematical, logical, and analytical problem-solving skills and who want to begin to learn the Java programming language; and for novice programmers and those programmers who prefer to start learn- ing the Java programming language at an introductory level. After successfully completing this certification, candidates can confidently utilize their knowledge on Java datatypes, operators, statements, arrays, lists, and exception-handling techniques

Рекомендую внимательно разобрать каждый.

Специально сделал в виде скриншотов, что бы отвечал по памяти 🙂

What is the result?

a.

[A, D, B, C]

b. [A, D, C]

c. [D, B, C]

d. [D, B12, C]

Which statement is true about this code?

a. It creates an object and the object is eligible for garbage collection.

b. It creates an object and the object is not eligible for garbage collection.

c. It creates two objects: e and e1. The e object is eligible for garbage collection.

d. It creates two objects and both the objects are not eligible for garbage collection.

Снимок экрана 2015-08-17 в 12.27.52

Which code fragment can be inserted at line n1 to enable the Shop class to compile?

a. final class Cart

b. public class Cart

c. private class Cart

d. protected class Cart

 

Which modification enables the code to compile?

a. Replace line n1 with double wage = 2;

b. Replace line n2 with long monDays = weekDays * 4L;

c. Replace line n3 with long yearDays = monDays * 12;

d. Replace line n4 with long totalWage = yearDays * (long) wage;

Ответы под слайдером ниже