OCA Java Exam

Exit

Question 1 of 1

  Time Left


0 [{"id":110389,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:51:03","updated_at":"2016-10-07 13:09:27","questionName":"Examine the following code and select the correct option(s):","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-02.png","position":1,"explanation":"This class isn\u2019t well encapsulated because its instance variable height is defined as a public member. Because the instance variable can be directly accessed by other classes, the variable doesn\u2019t always use the method setHeight to set its height. The cla","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110405,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:11:05","updated_at":"2016-10-07 13:09:27","questionName":"What is the output of the following code?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q4-02.png","position":14,"explanation":"Because a char value can be assigned to an int value, you might assume that a char array can be assigned to an int array. But we\u2019re talking about arrays of int and char primitives, which aren\u2019t the same as a primitive int or char. Arrays themselves are re","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110403,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:09:47","updated_at":"2016-10-07 13:09:27","questionName":"What is the output of the following code?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q4-01.png","position":13,"explanation":"The previous code won\u2019t compile due to the following line of code: arr[3] = longVar; This line of code tries to assign a value of type long to a variable of type int. Because Java does support implicit widening conversions for variables, the previous code","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110392,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:55:17","updated_at":"2016-10-07 13:09:27","questionName":"Does the following method correctly accepts three whole numbers as method arguments and returns their sum as a decimal number?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-03c.png","position":4,"explanation":"This method doesn\u2019t accept integers as the method arguments. The type of the method argument arg3 is double, which isn\u2019t an integer.","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110393,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:56:19","updated_at":"2016-10-07 13:09:27","questionName":"Does the following method correctly accepts three whole numbers as method arguments and returns their sum as a decimal number?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-03d.png","position":5,"explanation":"Even though the name of the method seems weird, it accepts the correct argument list (all integers) and returns the result in the correct data type (float).","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110394,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:57:36","updated_at":"2016-10-07 13:09:27","questionName":"Which of the following statements are true?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":null,"position":6,"explanation":"Option (e) is incorrect. There is no constraint on the number of arguments that can be passed on to a method, regardless of whether the method returns a value. Option (f) is incorrect. You can\u2019t return the value null for methods that return primitive data","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110402,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:07:54","updated_at":"2016-10-07 13:09:27","questionName":"Select the incorrect options:","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":null,"position":12,"explanation":"Option (a) is incorrect. If a user defines a constructor for a class with any access modifier, it\u2019s no longer an eligible candidate to be provided with a default constructor. Option (b) is correct. A class gets a default constructor only when it doesn\u2019t h","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110400,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:04:30","updated_at":"2016-10-07 13:09:27","questionName":"Given the following code, what is the output of the following code?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-08.png","position":10,"explanation":"No compilation issues exist with the code. You can overload methods by changing the type of the method arguments in the list. Using method arguments with data types having a base-derived class relationship (Object and String classes) is acceptable. Using ","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110396,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:00:59","updated_at":"2016-10-07 13:09:27","questionName":"What is the output of the following code?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-06.png","position":8,"explanation":"When primitive data types are passed to a method, the values of the variables in the calling method remain the same. This behavior doesn\u2019t depend on whether the primitive values are reassigned other values or modified by addition, subtraction, or multipli","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110391,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:53:56","updated_at":"2016-10-07 13:09:27","questionName":"Does the following method correctly accepts three whole numbers as method arguments and returns their sum as a decimal number?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-03b.png","position":3,"explanation":"This method accepts three integer values: byte, int, and int. It computes the sum of these integer values and returns it as a decimal number (data type double). Note that the name of the method is subtractNumbers, which doesn\u2019t make it an invalid option. ","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110390,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:52:59","updated_at":"2016-10-07 13:09:27","questionName":"Does the following method correctly accepts three whole numbers as method arguments and returns their sum as a decimal number?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-03a.png","position":2,"explanation":"The question specifies the method should return a decimal number (type double or float), but this method doesn\u2019t return any value.","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110401,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:06:45","updated_at":"2016-10-07 13:09:27","questionName":"Examine the following code and select the correct options:","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-09.png","position":11,"explanation":"You can define overloaded constructors with different access modifiers in the same way that you define overloaded methods with different access modifiers. But a change in only the access modifier can\u2019t be used to define overloaded methods or constructors.","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110395,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:59:33","updated_at":"2016-10-07 13:09:27","questionName":"Given the following definition of class Person, what is the output of the following code?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-05.png","position":7,"explanation":"The class EJavaGuruPassObject1 defines two methods, someMethod and anotherMethod. The method someMethod modifies the value of the object parameter passed to it. Hence, the changes are visible within this method and in the calling method (method main). But","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110397,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 13:02:31","updated_at":"2016-10-07 13:09:27","questionName":"Given the following signature of method eJava, choose the options that correctly overload this method:","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":"uploads\/oca-java-exam\/Q3-07.png","position":9,"explanation":"Option (a) is incorrect. Overloaded methods can change the access modifiers, but changing the access modifier alone won\u2019t make it an overloaded method. This option also changes the names of the method parameters, but that doesn\u2019t make any difference to a ","question_score_id":null,"lang":null,"questionAudioPath":null},{"id":110388,"quiz_id":"7402","answer_id":null,"answerType_id":"0","created_at":"2016-10-05 12:48:49","updated_at":"2016-10-07 13:09:27","questionName":"How can you include encapsulation in your class design?","questionTimeSeconds":"0","questionTimeMinutes":"2","questionImagePath":null,"position":0,"explanation":"A well-encapsulated class should be like a capsule, hiding its instance variables from the outside world. The only way you should access and modify instance variables is through the public methods of a class to ensure that the outside world can access onl","question_score_id":null,"lang":null,"questionAudioPath":null}]
110389
0
120
block

Examine the following code and select the correct option(s):

Select the correct answer(s).  

(0/0)














110405
0
120
none
110403
0
120
none
110392
0
120
none
110393
0
120
none
110394
0
120
none
110402
0
120
none
110400
0
120
none
110396
0
120
none
110391
0
120
none
110390
0
120
none
110401
0
120
none
110395
0
120
none
110397
0
120
none
110388
0
120
none