Model 204 and Java Programming Quiz

Questions covering Model 204 procedure language syntax and Java programming concepts including arrays, methods, inheritance, and flow control

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Class Y is a subclass of Class X.Will this compile? Y myY=new Y(); X myX=myY;

  1. No
  2. Compile Error
  3. Yes
  4. Runtime Error
  5. Not Sure
Question 2 True/False

In a Switch construct ,the default statement must be placed after all the case statements.

  1. True
  2. False
Question 3 True/False

This is a legal way to create an instance of an inner class: OuterClass.InnerClass x=new OuterClass().InnerClass();

  1. True
  2. False
Question 4 True/False

A method with no access modifier can be overridden by a method marked protected.

  1. True
  2. False
Question 5 True/False

When an array is constructed,are its elements automatically initialized?

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

What happens when this is in your code? double x; x=24.0/0;

  1. Compiler Error
  2. Compiles and runs
  3. Runtime Error
  4. None of these
Question 7 Multiple Choice (Single Answer)

Abbreviation for FIND AND PRINT COUNT is

  1. a) FP
  2. b) FPC
  3. c) Both (a) & (b)
  4. d) None of the above
Question 8 Multiple Choice (Single Answer)

Which one of the following terminates the request and returns you to command level

  1. STOP
  2. END
  3. END NORUN
  4. CANCEL
Question 9 Multiple Choice (Single Answer)

A: IN RSREFR FDWOL RECTYPE = REPORT END FIND PLACE RECORDS IN A ON LIST ABC RELEASE RECORDS ON LIST ABC CT: COUNT RECORDS ON LIST ABC PRINT COUNT IN CT What will be the value of count in label CT

  1. Will be the number of records on LIST ABC
  2. Will be equal to the number of records in label A
  3. Zero
  4. Both (a) & (b) are correct
Question 10 Multiple Choice (Single Answer)

Suppose “AGE” is the field name and you want to get the value of age between 10 and 20, which of the following statement is correct ?

  1. AGE IS BETWEEN 10 AND 20
  2. AGE BETWEEN 10 AND 20
  3. AGE ONLY BETWEEN 10 AND 20
  4. AGE BETWEEN 10 ,20
Question 11 Multiple Choice (Single Answer)

The statement which allows you to add new records to m204 file is:

  1. Store
  2. ADD RECORD
  3. STORE RECORD
  4. INSERT RECORD
Question 12 Multiple Choice (Single Answer)

The statement to add new field value to a record is:

  1. INSERT
  2. ADD
  3. STORE
  4. INSERT INTO
Question 13 Multiple Choice (Single Answer)

You can use global variables to:

  1. Pass information from one request to another request
  2. Include procedures conditionally at the Model 204 command level
  3. Tailor a request dynamically
  4. All the above
Question 14 Multiple Choice (Single Answer)

Functions in the M204 procedure are prefixed with

  1. %
  2. $
  3. ?
  4. #
Question 15 Multiple Choice (Single Answer)

Which function strips the leading and trailing blanks of a string?

  1. $STRIP
  2. $DECODE
  3. $DEBLANK
  4. $EDIT
Question 16 Multiple Choice (Single Answer)

What will be the result of $EDIT(25.734,'99999.99') statement ?

  1. 25.73
  2. 025.73
  3. 0025.73
  4. 00025.73
Question 17 Multiple Choice (Single Answer)

What will be the result of $VNUM(’ -256.73 AB’)statement?

  1. -256.73
  2. 256
  3. 0
  4. 1
Question 18 Multiple Choice (Single Answer)

A: IN RSREFR FDWOL RECTYPE = REPORT END FIND PLACE RECORDS IN A ON LIST ABC CT: COUNT RECORDS ON LIST ABC PRINT COUNT IN CT What will be the value of count in label CT

  1. Will be the number of records on LIST ABC
  2. Will be equal to the number of records in label A
  3. Zero
  4. Both (a) & (b) are correct
Question 19 Multiple Choice (Single Answer)

Statement which indicates the end of a subroutine is:

  1. END
  2. SUBROUTINE END
  3. END SUBROUTINE
  4. CLOSE SUBROUTINE
Question 20 Multiple Choice (Single Answer)

Which statement indicates the beginning of a subroutine

  1. BEGIN SUBROUTINE
  2. SUBROUTINE
  3. SUBROUTINE BEGIN
  4. START SUBROUTINE