Help shape GoConqr. What should we add next?

Quiz

OCA Exam Objectives 2.1 / 2.2

juanpelaez41 18 questions

Take the quiz

Questions in this quiz (18)

  1. 1You need to create an application that is used to calculate the attendance at a baseball game. What data type would be most appropriate for storing the attendance?
    1. Aboolean
    2. Bchar
    3. Cfloat
    4. Dint
  2. 2What is the best data type to use if you are required to perform many addition, subtraction, and multiplication calculations on a whole number?
    1. Adouble
    2. BDouble
    3. Cint
    4. DInteger
  3. 3You are writing a class that will store the status of an on/off switch. Which data type is most appropriate for storing this value?
    1. Aboolean
    2. Bchar
    3. Cshort
    4. Dint
  4. 4You have decided on the data type for a variable that will store the information about the on/off switch. Now you must determine a name for it. Which of the following names follows the Java naming conventions?
    1. ALIGHTSWITCHENABLED
    2. BLightSwitchEnabled
    3. ClightSwitchEnabled
    4. Dx
  5. 5What is the best data type to use when storing a status code that may have one of the following values: success, failed, success with errors, or undetermined?
    1. AObject
    2. BClass
    3. Cboolean
    4. Denum
    5. Eint
  6. 6A system has three sensors attached to it. You need a way to represent this system in your program. What would be the best data type to use to model this system and sensors?
    1. AObject
    2. Bboolean
    3. Cenum
    4. Dint
  7. 7The "new" keyword is used to initialize which of the following data types? (Choose all that apply.)
    1. AObject
    2. Bboolean
    3. CBoolean
    4. DFloat
    5. Efloat
    6. Ffloat[]
  8. 8 In the following line of code, what does the (int) represent?
    number = (int)sensorReading;
    1. ARounding the sensorReading variable to the nearest int
    2. BCasting the sensorReading variable to the int data type
    3. CNothing; it is there as a comment
  9. 9Given the following line of code, which of the lines of code listed are incorrect? (Choose all that apply.)
    char c;
    1. Ac = new char();
    2. Bc = 'Y';
    3. Cc = '\u0056';
    4. Dc = "Yes";
  10. 10Which of the following variables are being set with the use of a literal? (Choose all that apply.)
    1. Aint tvChannel = 4;
    2. Bchar c = '5';
    3. Cchar d = '\u0123';
    4. D char e = c;
    5. Eint oldChannel = tvChannel;

Information

Description
Differentiate between object reference variables and primitive variables
Language
Español
Views
56
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What should we add next?