3 Months Free Update
3 Months Free Update
3 Months Free Update
Given these requirements:
Which set of actions meets the requirements with optimized code?
Given the code fragment:
Which option can replace xxx to enable the code to print 135?
Given:
What is the result? A. 0:0
100:0
B.null:0
100:0
C.0:0
100:200
D.null:null 100:null
You are developing a banking module. You have developed a class named ccMask that has a maskcc method.
Given the code fragment:
You must ensure that the maskcc method returns a string that hides all digits of the credit card number except the four last digits (and the hyphens that separate each group of four digits).
Which two code fragments should you use at line n1, independently, to achieve this requirement? (Choose two.)
Given the class definitions:
class C1 {}
class C2 extends C1 {}
class C3 extends C2 {}
and the code fragment:
16.C1 obj1 = (C1) new C2();
17.C2 obj2 = (C2) new C3();
18.C2 obj3 = (C2) new C1();
19.C3 obj4 = (C3) obj2;
Which line throws ClassCastException?
Given the code fragment:
Which two code fragments inserted at line 10 print ****?
Given this class:
Which two changes would encapsulate this class and ensure that the area field is always equal to length * height whenever the Rectangle class is used?
Given the code fragment:
Which three code fragments can be independently inserted at line n1 to enable the code to print One? (Choose three.)
Given the code fragment:
Which action enables the code to print Helping… Done?
Given the code fragment:
Which code fragment, when inserted at line 9, enables the code to print true?
Given the code fragment:
Which two modifications should you make so that the code compiles successfully? (Choose two.)
Examine the given definitions:
and the code fragment:
Which statement is true about the implementation of Object-Oriented Programming concepts in the given code?
Given:
And given the code fragment:
Book book1 = new EBook();
book1.readBook();
Which option enables the code to compile?
Given the code fragments:
Which code fragment, when inserted at line n1, enables the code to print Hank?
Given the code fragment:
Which code fragment, when inserted at line 3, enables the code to print 10:20?
Given the code fragment:
Which modification enables the code to print 54321?
Given the code fragment:
Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order? (Choose two.)
Which statement will empty the contents of a StringBuilder variable named sb?
Given:
and the code fragment:
S2 sobj = new S2(); sobj.display(10, 100);
What is the result?
Which three statements describe the object-oriented features of the Java language? (Choose three.)
Given the code fragment:
Which code fragment at line 10 prints Welcome 100?
Given the code snippet from a compiled Java source file:
and this output:
Which command should you run to obtain this output?
Which three statements are true about the structure of a Java class? (Choose three.)
Given this segment of code:
Which two statements, if either were true, would make the code compile? (Choose two.)