0

programming languages Online Quiz - 3

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

Which Interface has no methods.

  1. Servlet

  2. Runnable

  3. Serializable

  4. ActionListener


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Servlet - This option is incorrect. The Servlet interface in Java has several methods, such as init(), service(), and destroy(), which are used to handle HTTP requests and responses.

Option B) Runnable - This option is incorrect. The Runnable interface in Java has a single method called run(), which is used to define the code that will be executed in a separate thread.

Option C) Serializable - This option is correct. The Serializable interface in Java is a marker interface, which means it does not have any methods defined in it. It is used to indicate that a class can be serialized, i.e., its objects can be converted into a stream of bytes for storage or transmission.

Option D) ActionListener - This option is incorrect. The ActionListener interface in Java has a single method called actionPerformed(), which is used to handle action events, such as button clicks or menu selections.

The correct answer is C) Serializable. This option is correct because the Serializable interface does not have any methods defined in it.

When was James Gosling born.

  1. Jan 31, 2012

  2. Aug 08, 1987

  3. Aug 18, 1951

  4. May 19, 1955


Correct Option: D

Which time span is used to interpret two-digit year values if the YEARCUTOFF= option is set to 1950?

  1. 1950-2049

  2. 1950-2050

  3. 1949-2050

  4. 1950-2000


Correct Option: A

Which DO statement would not process all the elements in the tmp array shown below? array tmp{*} x y z a;

  1. do i=1 to dim(tmp);

  2. do i=1 to dim(*);

  3. do i=1,2,3,4;

  4. do i=1 to 4;


Correct Option: B

Which keyword, when added to the PROC FORMAT statement, will display all the formats in your catalog?

  1. FMTCAT

  2. CATALOG

  3. FMTLIB

  4. LISTFMT


Correct Option: C

AI Explanation

To display all the formats in your catalog, you need to add the keyword "FMTLIB" to the PROC FORMAT statement.

Let's go through each option to understand why it is correct or incorrect:

Option A) FMTCAT - This option is incorrect because the "FMTCAT" keyword is not used to display all the formats in your catalog.

Option B) CATALOG - This option is incorrect because the "CATALOG" keyword is not used to display all the formats in your catalog.

Option C) FMTLIB - This option is correct because the "FMTLIB" keyword is used to display all the formats in your catalog.

Option D) LISTFMT - This option is incorrect because the "LISTFMT" keyword is not used to display all the formats in your catalog.

The correct answer is C) FMTLIB. This option is correct because adding the "FMTLIB" keyword to the PROC FORMAT statement will display all the formats in your catalog.

Using ODS statements, how many types of output can you generate at once?

  1. 2

  2. 3

  3. 1 (only listing output)

  4. as many as you want


Correct Option: D

Which of the following would you use to compare the result of investing $X a year for 6 years in three different banks that compound interest monthly? Assume a fixed rate for the 6-year period.

  1. DO WHILE statement

  2. nested DO loops

  3. a DO group

  4. DO UNTIL statement


Correct Option: B

Macro character functions

  1. can be used to manipulate character strings in macro variable values.

  2. have the same basic syntax as the corresponding DATA step functions and yield similar results.

  3. all of the above

  4. none of the above


Correct Option: C
  1. %let currdate = %sysfunc(today(), worddate.);

  2. %let currdate = &sysdate9;

  3. %let currdate = %sysfunc(date());

  4. all of the above


Correct Option: D

What happens if you use a GROUP BY clause in a PROC SQL step without a summary function?

  1. The step does not execute.

  2. The first numeric column is summed by default.

  3. The GROUP BY clause is changed to an ORDER BY clause.

  4. The step executes but does not group or sort data.


Correct Option: C

SAS is not portable ...

  1. True

  2. False


Correct Option: B

SAS is a free format language

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, it is important to understand what a "free format language" means.

A free format language refers to a programming language that allows flexibility in how code is written and formatted. It typically does not impose strict rules on indentation, line breaks, or spacing. This flexibility allows programmers to write code in a way that is more readable and easier to maintain.

SAS (Statistical Analysis System) is a programming language commonly used for data analysis and statistical modeling. In SAS, code can be written in a free format style. This means that SAS does not impose strict rules on indentation, line breaks, or spacing.

Based on this information, the statement that "SAS is a free format language" is true. Option A is correct.

SAS Statements are not case sensitive

  1. True

  2. False


Correct Option: A

SAS Key words can't be used as variable names

  1. True

  2. False


Correct Option: B

SAS Statements can span more than one line

  1. True

  2. False


Correct Option: A

Which of the following functions will be invoked on the function call- show(10);

  1. show(byte b){ }

  2. show(long l){ }

  3. none of the above

  4. compilation error


Correct Option: B
  1. show(float f){ }

  2. show(int i){ }

  3. show(double d){ }

  4. none of the above


Correct Option: A
- Hide questions