0
Alien head

programming languages Online Quiz - 174

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

What happens when the following code is compiled and run. Select the one correct answer. for(int i = 2; i < 4; i++) for(int j = 2; j < 4; j++) if(i < j) assert i!=j : i;

  1. The class compiles and runs, but does not print anything.

  2. The number 2 gets printed with AssertionError

  3. compile error

  4. The number 3 gets printed with AssertionError


Correct Option: A

What does it print? public class Elementary { public static void main(String[] args) { System.out.println(12345 + 5432l); } }

  1. Compilation error

  2. Runtime error

  3. 17777

  4. 66666


Correct Option: C

Is this a legal Java Program? If so, what does it print? \u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020\u0020 \u0063\u006c\u0061\u0073\u0073\u0020\u0055\u0067\u006c\u0079 \u007b\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020 \u0020\u0020\u0020\u0020\u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028 \u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0020 \u0020\u0020\u0020\u0020\u0061\u0072\u0067\u0073\u0029\u007b \u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074 \u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0020 \u0022\u0048\u0065\u006c\u006c\u006f\u0020\u0077\u0022\u002b \u0022\u006f\u0072\u006c\u0064\u0022\u0029\u003b\u007d\u007d

  1. Its not possible

  2. print some garbage value

  3. compilation error

  4. Hello world


Correct Option: D

Provide a declaration for i that turns this loop into infinite loop: while( i != i + 0){ }

  1. Char i = 9

  2. int i = 3/7

  3. String i = "abc"

  4. int i = 0


Correct Option: C

Provide a declaration for i that turns this loop into an infinite loop: while( i != i){ }

  1. String i = "abc"

  2. double i = 0.0/0.0

  3. int i = 3/7

  4. int i = 0


Correct Option: B

A database administrator needs to create a tablespace for an Oracle database. He formulates the following statement: CREATE TABLESPACE frgr DATAFILE ‘/g01/oracle/data/sasa01.dbf’ SIZE 100M EXTENT MANAGEMENT DICTIONARY AUTOALLOCATE DEFAULT STORAGE ( INITIAL 100K NEXT 100K MINEXTENTS 5 MAXEXTENTS 25 PCTINCREASE 0); LOGGING TEMPORARY

  1. By default, tables within the tablespace will not have all its changes written to redo.

  2. It is a locally managed tablespace.

  3. A temporary tablespace has been created.

  4. An error will be produced; the AUTOALLOCATE parameter should be removed


Correct Option: D

Which of the following role properties would be beneficial if you want to grant privileges to a group of specified users to a certain role?

  1. Reduced privilege administration

  2. Selective availability of privileges

  3. Application awareness

  4. Application-specific security


Correct Option: A

Which of the following are valid predefined roles that can be used with Oracle databases?

  1. DBA

  2. RESOURCE

  3. CONNECT

  4. EXP_FULL_DATABASE

  5. IMP_FULL_DATABASE

  6. All the above


Correct Option: F

The database administrator is taking the cbgb tablespace offline, due to erroneous datafiles in the tablespace. Which offline tablespace option should be chosen?

  1. NORMAL

  2. TEMPORARY

  3. IMMEDIATE

  4. FOR RECOVER


Correct Option: B

What can be said of the following SQL statement? CREATE GLOBAL TEMPORARY TABLE extra_area (startdate DATE, enddate DATE, class CHAR(15)) ON COMMIT DELETE ROWS

  1. It is a session specific table.

  2. It is an invalid SQL statement.

  3. It is only available in Oracle 7

  4. It is a transaction specific table.


Correct Option: D

You are setting up two multiplexed online redo log file groups with three members in each group, how many disks are necessary at minimum?

  1. 3

  2. 0

  3. 1

  4. no disk required


Correct Option: A

identify the meaning of the following SQL statement CREATE USER PETRIE IDENTIFIED EXTERNALLY DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMPS QUOTA 12M ON forms

  1. The user is being validated by the enterprise directory service

  2. The user has unlimited quota on the USERS tablespace.

  3. The user’s quota will never exceed the size of the temporary tablespace.

  4. All options are correct.


Correct Option: B

Which of the following options will allow you to drop the user david and all objects in the schema that are associated with that user?

  1. DROP USER david all

  2. DROP USER david schema

  3. DROP USER david cascade

  4. DROP USER david cascade schema


Correct Option: C

Once defined, how long will a variable remain so in SQL*Plus?

  1. Until the database is shut down

  2. Until the instance is shut down

  3. Until the statement completes

  4. Until the session completes


Correct Option: C

Issuing the DEFINE_EDITOR=”emacs” will produce which outcome?

  1. The emacs editor will become the SQL*Plus default text editor.

  2. The emacs editor will start running immediately.

  3. The emacs editor will no longer be used by SQL*Plus as the default text editor.

  4. The emacs editor will be deleted from the system.


Correct Option: A

The NVL function

  1. Place the alias at the beginning of the statement to describe the table.

  2. Place the alias after each column, separated by white space, to describe the column.

  3. Place the alias after each column, separated by a comma, to describe the column

  4. Place the alias at the end of the statement to describe the table.


Correct Option: C

SELECT (TO_CHAR(NVL(SQRT(59483), “INVALID”)) FROM DUAL is a valid SQL statement

  1. True

  2. False


Correct Option: B

Creating a foreign-key constraint between columns of two tables defined with two different datatypes will produce an error.

  1. True

  2. False


Correct Option: A

Which function below can best be categorized as similar in function to an IF-THEN-ELSE statement?

  1. SQRT

  2. DECODE

  3. NEW_TIME

  4. ROWIDTOCHAR


Correct Option: B

MAXVALUE is a valid parameter for sequence creation.

  1. True

  2. False


Correct Option: A
+ View questions