0
Alien head

programming languages Online Quiz - 224

Description: programming languages Online Quiz - 224
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What is the range of values that can be assigned to a variable of type byte?

  1. It depends on the underlying hardware

  2. 0 through 28–1

  3. 0 through 216–1

  4. –27 through 27–1

  5. –215 through 215–1


Correct Option: D

How can you force garbage collection of an object in Java?

  1. Garbage collection cannot be forced

  2. Call System.gc()

  3. Call System.gc(), passing in a reference to the object to be garbage-collected

  4. Call Runtime.gc()

  5. Set all references to the object to new values (null, for example)


Correct Option: A

Consider the following line of code: int x[] == new int[25]; After execution, which statement or statements are true?

  1. x[24] is 0

  2. x[24] is undefined

  3. x[25] is 0

  4. x[0] is null

  5. x.length is 25


Correct Option: A,E

If all three top-level elements occur in a source file, they must appear in which order?

  1. Imports, package declaration, classes

  2. Classes, imports, package declarations

  3. Package declaration must come first; order for imports and class definitions is not

  4. Package declaration, imports, classes

  5. Imports must come first; order for package declaration and class definitions is not


Correct Option: D

Which of the following signatures are valid for the main() method entry point of an application?

  1. public static void main()

  2. public static void main(String arg[])

  3. public void main(String [] arg))

  4. public static void main(String[] args))

  5. public static int main(String [] arg))


Correct Option: B,D

Choose the valid identifiers from those listed below.

  1. BigOlLongStringWithMeaninglessName

  2. $int

  3. bytes

  4. $1

  5. finalist


Correct Option: A,B,C,D,E

A signed data type has an equal number of non-zero positive and negative values available.

  1. True

  2. False


Correct Option: B

The correct Syntax of a Bind Statement

  1. DSN SYSTEM(SSID) BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS)

  2. DSN SYSTEM(SSID) - BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS) -

  3. DSN SYSTEM(SSID) BIND PLAN(PLAN1) - MEMBER (PROGRAM1) - QUALIFIER(DB1) - ISOLATION(CS) -

  4. None of the above


Correct Option: A

Which is the correct syntax of DUMP Statement?

  1. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre | SHR} } {SPHERE} {OUTDDname | ODD} (ddn {,ddn,...)

  2. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre ¦ SHR} } {SPHERE} {OUTDDname ¦ ODD} (ddn {,ddn,...)

  3. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre | SHR} } {SPHERE} {OUTDDname | EVEN} (ddn {,ddn,...)

  4. DUMP DATASET | DS (INCLUDE(dsn,…) ALLData(dsn | (*)) ALLExcp | ALLX { {SHAre ¦ SHR} } {SPHERE} {OUTDDname ¦ EVEN} (ddn {,ddn,...)


Correct Option: B

Which of the following syntax is not correct?

  1. //STEP40 EXEC PGM=IDCAMS,REGION=2048K //SYSPRINT DD SYSOUT=* DEFINE CLUSTER (NAME(USERID.TEST.VSAM)- VOL(*)- TRK(1,2)- INDEXED- SPEED-

  2. //JSTY0020 EXEC PGM=IDCAMS,COND=(0,NE) //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD *

  3. //STEP20 EXEC PGM=IDCAMS,REGION=2048K //SYSPRINT DD SYSOUT=* DELETE USERID.TEST.VSAM' SET MAXCC = 0

  4. None of the above


Correct Option: B

Which of the following is not applicable in LIKE parameter?

  1. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  2. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  3. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG(+1), //SAMPLE DDDSN=M

  4. //TESTJOB JOB (ER456),‘XXXXX‘ //STEP1 EXEC PGM=IEFBR14 //SYSOUT DD SYSOUT=* //OUTPU1 DD DSN=MYLIB.TEST.GDG, //SAMPLE DDDSN=MYLIB


Correct Option: A

Correct Syntax for RESTORE Statement

  1. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  2. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  3. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,

  4. //JOB1 JOB accounting information //STEP1 EXEC PGM=ADRDSSU //SYSPRINT DD SYSOUT=A //TAPE DD UNIT=3480,VOL=SER=(TAPE01,TAPE02), // LABEL=(1,SL),DISP=(OLD,


Correct Option: C

Syntax of OBJECT Parameter

  1. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INFILE(DD1) OUTDATASET(USERID.TEST.VSAM) /*

  2. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INFILE(DD1) OUTFILE(USERID.TEST.VSAM) /*

  3. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INDATASET(DD1) OUTDATASET(USERID.TEST.VSAM) /*

  4. //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=USERID.KSDS.BACKUP,DISP=SHR //SYSIN DD * IMPORT INDATASET(DD1) OUTFILE(USERID.TEST.VSAM) /*


Correct Option: A

Which function can be used to make sure your program exits with a nonzero status even if there a standard error?

  1. hash

  2. noexit

  3. nozero

  4. die


Correct Option: D

Which statement will print the capital attribute of the $kansas object?

  1. print ("capital"=>$kansas);

  2. print {$kansas}=>(capital);

  3. print (capital)<={$kansas};

  4. print $kansas->{"capital"};


Correct Option: D

Which operator can be used to access the first item in an array?

  1. shift

  2. start

  3. right$

  4. left$


Correct Option: A

If $string contains abcdabcd , what will the following call return? index ($string, “cd”, 3);

  1. 6

  2. 4

  3. -1

  4. 3


Correct Option: A

If $string contains abcdefgh , what will the following call return? substr($string, -2, 2);

  1. abc

  2. efgh

  3. gh

  4. None


Correct Option: C

What argument to splice is equivalent to push (@array, @sublist) function call?

  1. splice (@array,[email protected]);

  2. splice (@array, scalar(@array),0, @sublist);

  3. splice (@array, 1, 0, @sublist);

  4. None


Correct Option: B

Assume @list contains (“1”, “2”, “3”, “4”, “5” ). What is the content of @list after the following statement splice (@list, -1, 1, “test1”. “test2”);

  1. (“1”, “2”, “3”, “4”, “test1”, “test2”)

  2. ( “2”, “3”, “4”, “test1”, “test2”)

  3. (“1”, “3”, “4”, “test1”, “test2”)

  4. (“1”, “test1”, test2”, “2”, “3”, “4” )


Correct Option: A
+ View questions