0

programming languages Online Quiz - 247

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

What is the signature of the constructor of a thread class?

  1. Thread(Runnable threadob,String threadName)

  2. Thread(String threadob, Runnable threadName)

  3. Thread(Runnable threadob,ArrayList threadName)

  4. Thread(ArrayList threadob,String threadName


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax and signature of the constructor of the Thread class in Java.

The constructor signature for the Thread class is:

Thread(Runnable threadob, String threadName)

This constructor creates a new thread object with the specified name and the given runnable object.

Now, let's go through each option and explain why it is right or wrong:

A. Thread(Runnable threadob, String threadName): This option is correct as it matches the signature of the Thread class constructor.

B. Thread(String threadob, Runnable threadName): This option is incorrect because the order of the parameters is reversed, and the first parameter is of type String, which is not valid for the Thread constructor.

C. Thread(Runnable threadob, ArrayList threadName): This option is incorrect because the second parameter should be of type String, not ArrayList.

D. Thread(ArrayList threadob, String threadName): This option is incorrect because the first parameter should be of type Runnable, not ArrayList.

Therefore, the answer is:

The Answer is: A

Which of the following are true about the Error and Exception classes?

  1. Both classes extend Throwable.

  2. The Error class is final and the Exception class is not.

  3. The Exception class is final and the Error is not.

  4. Both classes implement Throwable.


Correct Option: A

The run() method should necessary exists in class created as subclass of thread?

  1. True

  2. False


Correct Option: A
Explanation:

To solve this question, the user needs to have knowledge about the Thread class and its methods.

The Thread class is a built-in class in Python that is used to create new threads of execution. A thread is a lightweight process that runs concurrently with other threads in a process.

When creating a subclass of the Thread class, the run() method is the method that is executed when the start() method is called on an instance of the class. The run() method contains the code that will be executed in the new thread.

Therefore, the run() method is necessary in a class created as a subclass of Thread class.

The answer is: A. True.

Which of the option correctly describes the comments in java 1) // -- single line comment 2) /* -- / multiple line comment 3) /* -- */ documentation

  1. 1,2

  2. 2,3

  3. 3,1

  4. 1,2,3


Correct Option: D

Which of the following classes is used to perform basic console I/O?

  1. System

  2. SecurityManager

  3. Math

  4. Runtime


Correct Option: A

Which of the following is not a wrapper class?

  1. String

  2. Integer

  3. Boolean

  4. Character


Correct Option: A

Which statement is used to mark the beginning of a job and assign a name to the job?

  1. JOB

  2. EXEC

  3. STEP

  4. PROC

  5. None of the above


Correct Option: A
Explanation:

To solve this question, the user needs to know the basics of JCL (Job Control Language) used in Mainframe systems.

The statement used to mark the beginning of a job and assign a name to the job is the JOB statement.

A. JOB: This option is correct. The JOB statement is used to mark the beginning of a job and assign a name to the job.

B. EXEC: The EXEC statement is used to execute a program or procedure within a job, not to mark the beginning of the job.

C. STEP: The STEP statement is used to define a unit of work within a job, not to mark the beginning of the job.

D. PROC: The PROC statement is used to define a procedure, which can be called from within a job using the EXEC statement, but it is not used to mark the beginning of the job.

E. None of the above: This option is incorrect because the correct answer is A.

Therefore, the answer is: A. JOB

Which statement is used to mark the beginning of a job step, to assign a name to the step and to identify the program or procedure to be executed in the step?

  1. JOB

  2. EXEC

  3. STEP

  4. PROC

  5. None of the above


Correct Option: B

Which statement marks the end of an in-stream or cataloged procedure?

  1. JOB

  2. EXEC

  3. PROC

  4. PEND

  5. None of the above


Correct Option: D

Which statement marks the beginning of an in-stream procedure and assigns default values to parameters defined in the procedure?

  1. JOB

  2. EXEC

  3. PROC

  4. PEND

  5. None of the above


Correct Option: C
Explanation:

To answer this question, the user needs to have knowledge of the JCL (Job Control Language) used in mainframe systems.

The correct answer is option C, PROC.

Explanation:

In JCL, PROC is used to define a procedure. A procedure is a set of JCL statements that can be reused in multiple jobs.

When defining a procedure, default values can be assigned to the parameters defined in the procedure. These default values are used if the parameter values are not specified in the job step that calls the procedure.

Therefore, option C, PROC, marks the beginning of an in-stream procedure and assigns default values to parameters defined in the procedure.

Option A, JOB, is used to identify the start of a job and specify job-level parameters.

Option B, EXEC, is used to identify the start of a job step and specify step-level parameters.

Option D, PEND, is not a valid JCL keyword.

Option E, None of the above, is incorrect as the correct answer is option C, PROC.

Thus, the answer is: C. PROC

Which statement marks the beginning of one or more program control statements?

  1. JOB

  2. EXEC

  3. PROC

  4. PEND

  5. CNTL


Correct Option: E

If the Status field of the DISP Parameter is left out, it is defaulted to which of the following?

  1. NEW

  2. SHR

  3. OLD

  4. KEEP

  5. None of the above


Correct Option: A

If the status field of the DISP parameter is specified as SHR, what are the default values that will be assigned to the dataset at the normal and abnormal termination of the job?

  1. CATLG, DELETE

  2. DELETE, DELETE

  3. CATLG, CATLG

  4. DELETE, CATLG

  5. KEEP, KEEP


Correct Option: E

If the status field of the DISP parameter is specified as NEW, what are the default values that will be assigned to the dataset at the normal and abnormal termination of the job?

  1. CATLG, DELETE

  2. DELETE, DELETE

  3. CATLG, CATLG

  4. DELETE, CATLG

  5. KEEP, KEEP


Correct Option: B

AI Explanation

To answer this question, we need to understand the DISP parameter in JCL (Job Control Language) and its possible values.

The DISP parameter is used to specify the disposition of a dataset. It determines what happens to the dataset at different stages of the job execution, such as normal termination or abnormal termination.

When the status field of the DISP parameter is specified as NEW, the dataset is considered to be a new dataset. Let's go through each option to determine the default values assigned to the dataset at normal and abnormal termination:

Option A) CATLG, DELETE - This option is incorrect because the default value at normal termination is DELETE, not CATLG. Option B) DELETE, DELETE - This option is correct because the default value at both normal and abnormal termination is DELETE. Option C) CATLG, CATLG - This option is incorrect because the default value at normal termination is DELETE, not CATLG. Option D) DELETE, CATLG - This option is incorrect because the default value at normal termination is DELETE, not CATLG. Option E) KEEP, KEEP - This option is incorrect because the default value at normal termination is DELETE, not KEEP.

The correct answer is B. The default values assigned to the dataset at the normal and abnormal termination of the job, when the status field of the DISP parameter is specified as NEW, are DELETE and DELETE respectively.

10) If the DISP is specified as (NEW, CATLG, KEEP), what happens on abnormal termination of the job? (a) (b) (c) (d)

  1. The system retains and catalogs the dataset

  2. the system catalogs the dataset

  3. the system retains the dataset

  4. none of the above


Correct Option: C

AI Explanation

To answer this question, we need to understand what the DISP parameter specifies in a job.

The DISP parameter is used in JCL (Job Control Language) to control the disposition of a dataset. It determines what action the system should take with the dataset after the job completes or terminates abnormally.

In this case, the DISP is specified as (NEW, CATLG, KEEP). Let's go through each option to understand what happens on abnormal termination of the job:

Option A) The system retains and catalogs the dataset - This option is incorrect. The DISP parameter with "KEEP" only retains the dataset, but it does not catalog it. Cataloging means adding the dataset to the system's catalog, which is a directory of datasets that can be referenced by other jobs.

Option B) The system catalogs the dataset - This option is incorrect. The DISP parameter with "CATLG" catalogs the dataset, but it does not retain it. This means that if the job terminates abnormally, the dataset will not be retained.

Option C) The system retains the dataset - This option is correct. The DISP parameter with "KEEP" retains the dataset, even if the job terminates abnormally. This means that the dataset will still be available for future use.

Option D) None of the above - This option is incorrect, as option C is the correct answer.

Therefore, the correct answer is C) The system retains the dataset. This option is correct because the DISP parameter with "KEEP" ensures that the dataset is retained, even on abnormal termination of the job.

XML allows the author to define his own tags and his own document structure

  1. True

  2. False


Correct Option: A

Which of the following Utilities is used to create GDG Index?

  1. IEBGENER

  2. IDCAMS

  3. IEFBR14

  4. INDEX

  5. None of the above


Correct Option: B

With the condition parameter defined as COND – ((4, GE), (9, LT)) which of the return codes will execute the subsequent step

  1. 4

  2. 9

  3. 10

  4. 11

  5. none of the above


Correct Option: B

AI Explanation

To answer this question, we need to understand the syntax and logic of the condition parameter.

The condition parameter is defined as COND – ((4, GE), (9, LT)).

Let's break down the condition parameter into its components:

  • (4, GE): This means that the condition is true if the value being tested is greater than or equal to 4.
  • (9, LT): This means that the condition is true if the value being tested is less than 9.

Based on the given options, we need to determine which return code will execute the subsequent step.

Option A: 4 This option will not execute the subsequent step because the condition parameter requires the value to be greater than or equal to 4, not exactly 4.

Option B: 9 This option will execute the subsequent step because the condition parameter requires the value to be less than 9.

Option C: 10 This option will not execute the subsequent step because the condition parameter requires the value to be less than 9.

Option D: 11 This option will not execute the subsequent step because the condition parameter requires the value to be less than 9.

Therefore, the correct answer is option B. The subsequent step will execute if the return code is 9.

What is the conventional DD name assigned to input data streams?

  1. SYSPRINT

  2. SYSIN

  3. SYSUT1

  4. SYSOUT


Correct Option: C
- Hide questions