0

programming languages Online Quiz - 65

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

Java enables the creation of cross-platform programs by compiling into an intermediate representation called Java ____________.

  1. Byte Code

  2. Firewall

  3. Class Code

  4. Bit Code


Correct Option: A

There are _____ types of Comments in Java.

  1. One

  2. Two

  3. Three

  4. Four


Correct Option: C

All statements in Java end with a _____________.

  1. Colon

  2. SemiColon

  3. Hypen

  4. Dot


Correct Option: B

The simplest form of the for loop in Java is for(initialization; condition; iteration) statement;

  1. True

  2. False


Correct Option: A

AI Explanation

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

Option A) True - This option is correct because the simplest form of the for loop in Java consists of three components: initialization, condition, and iteration. The loop will continue executing the statement as long as the condition is true.

Option B) False - This option is incorrect because the simplest form of the for loop in Java is indeed for(initialization; condition; iteration) statement.

The correct answer is A) True.

The print( ) method is just like println( ), except that it does not output a newline character after each call.

  1. True

  2. False


Correct Option: A

What is delegate in C++?

  1. Functions

  2. Templates

  3. Function pointers

  4. Pointer of pointers


Correct Option: C

_tcscat(str1, str2) function in C++ is similar to this in C Sharp.

  1. strcat(str1,str2)

  2. str1.Append(str2)

  3. str1.CopyAtEnd(str2)

  4. str1=str1+str2


Correct Option: D

FILE *fp=_tfopen("c:\test.txt","rws"); this code is equivalent to in C#

  1. FileStream fp= new FileStream("c:\test.txt", FileMode.Create, FileAccess.Write,FileShare.Read);

  2. FileStream fp= new FileStream("c:\test.txt", "rws");

  3. FileStream fp= new FileStream("c:\test.txt", FileMode.ReadWriteShared);

  4. FileStream fp= new FileStream("c:\test.txt", FileMode.ReadWrite, FileAccess.Shared);


Correct Option: A

namespace keyword in C# and C++ refers to

  1. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is used to define templates

  2. namespace in C# and C++ are for same purpose

  3. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is used to define STL classes

  4. namespace in C# refers to a holder where name collisions can be avoided whereas in C++ it is undefined.


Correct Option: B

C++ uses pointers. Choose the one which is not TRUE about C Sharp.

  1. Pointers are not supported in C#

  2. Pointers are supported in C# as is in C++

  3. Pointers are replaced by delegates

  4. Pointers can be used by declaring unsafe blocks


Correct Option: D

Which two statements are true regarding the USING clause in table joins?

  1. It can be used to join a maximum of three tables

  2. It can be used to restrict the number of columns used in a NATURAL join

  3. It can be used to access data from tables through equijoins as well as nonequijoins

  4. It can be used to join tables that have columns with the same name and compatible data types


Correct Option: B,D

Which two statements are true about sequences created in a single instance database?

  1. The numbers generated by a sequence can be used only for one table

  2. DELETE would remove a sequence from the database

  3. CURRVAL is used to refer to the last sequence number that has been generated

  4. When the MAXVALUE limit for a sequence for reached, you can increase the MAXVALUE limit by using the ALTER SEQUENCE statement


Correct Option: C,D

Which three statements are true about multiple-row subqueries?

  1. They can contain a subquery within a subquery.

  2. They can return multiple columns as well as rows.

  3. They cannot contain a subquery within a subquery.

  4. They can return only one column but multiple rows.

  5. They can contain group functions and GROUP BY and HAVING clauses.

  6. They can contain group functions and the GROUP BY clause, but not the HAVING clause.


Correct Option: A,B,E

Which three statements/commands would cause a transaction to end?

  1. COMMIT

  2. SELECT

  3. CREATE

  4. ROLLBACK

  5. SAVEPOINT


Correct Option: A,C,D

Which arithmetic operations can be performed on a column by using a SQL function that is built into Oracle database?

  1. addition

  2. subtraction

  3. raising to a power

  4. finding the quotient

  5. finding the lowest value


Correct Option: A,C,E

Which three statements are true regarding subqueries?

  1. Subqueries can contain GROUP BY and ORDER BY clauses

  2. Main query and subquery can get data from different tables

  3. Main query and subquery must get data from the same tables

  4. Subqueries can contain ORDER BY but not the GROUP BY clause

  5. Only one column or expression can be compared between the main query and subqeury

  6. Multiple columns or expressions can be compared between the main query and subquery


Correct Option: A,B,F

AI Explanation

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

Option A) Subqueries can contain GROUP BY and ORDER BY clauses - This option is true. Subqueries can contain GROUP BY and ORDER BY clauses to perform aggregations or sort the data within the subquery.

Option B) Main query and subquery can get data from different tables - This option is true. The main query and subquery can retrieve data from different tables. In fact, one of the main uses of subqueries is to retrieve data from related tables.

Option C) Main query and subquery must get data from the same tables - This option is false. The main query and subquery can get data from different tables. They can even have different conditions or criteria to retrieve data.

Option D) Subqueries can contain ORDER BY but not the GROUP BY clause - This option is false. Subqueries can contain both the ORDER BY and GROUP BY clauses. These clauses can be used to sort or group the data within the subquery.

Option E) Only one column or expression can be compared between the main query and subquery - This option is false. Multiple columns or expressions can be compared between the main query and subquery. This allows for more complex conditions and comparisons.

Option F) Multiple columns or expressions can be compared between the main query and subquery - This option is true. Multiple columns or expressions can be compared between the main query and subquery. This allows for more flexibility in filtering and retrieving the desired data.

Based on the explanations above, the correct statements regarding subqueries are:

A. Subqueries can contain GROUP BY and ORDER BY clauses. B. The main query and subquery can get data from different tables. F. Multiple columns or expressions can be compared between the main query and subquery.

Therefore, the correct answer is A, B, and F.

You need to display the date ll-oct-2007 in words as "Eleventh of October, Two Thousand Seven'. Which SQL statement would give the required result?

  1. SELECT TO_CHAR('ll-oct-2007'. 'miDdspth "of Month. Year') FROM DUAL:

  2. SELECT TO_CHAR(TO_DATE('ll-oct-2007'X 'miDdspth of month, year') FROM DUAL;

  3. SELECT TO_CHAR(TO_DATE('ll-oct-2007'). 'miDdthsp "of* Month. Year') FROM DUAL;

  4. SELECT TO_DATE(TO_CHAR('ll-oct-20077fiiiDdspth "of" Month. Year')) FROM DUAL:


Correct Option: C

Which two statements are true regarding working with dates?

  1. The default internal storage of dates is in the numeric format

  2. The default internal storage of dates is in the character format

  3. The RR date format automatically calculates the century from the SYSDATE function and does not allow the user to enter the century

  4. The RR date format automatically calculates the century from the SYSDATE function but allows the user to enter the century if required


Correct Option: A,B

Which two statements are true regarding views?

  1. A subquery that defines a view cannot include the GROUP BY clause

  2. A view is created with the subquery having the DISTINCT keyword can be updated

  3. A view that is created with the subquery having the pseudo column ROWNUM keyword cannot be updated

  4. A Data Manipulation Language (DML) operation can be performed on a view that is created with the subquery having all the NOT NULL columns of a table


Correct Option: C,D

Which statement is true regarding the INTERSECT operator?

  1. It ignores NULL values

  2. Reversing the order of the intersected tables alters the result.

  3. The names of columns in all SELECT statements must be identical.

  4. The number of columns and data types must be identical for all SELECT statements in the


Correct Option: D

AI Explanation

To answer this question, you need to understand the INTERSECT operator in SQL, which is used to combine the result sets of two or more SELECT statements.

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

Option A) It ignores NULL values - This option is incorrect. The INTERSECT operator considers NULL values when comparing the results of the SELECT statements.

Option B) Reversing the order of the intersected tables alters the result - This option is incorrect. The order of the intersected tables does not affect the result of the INTERSECT operation.

Option C) The names of columns in all SELECT statements must be identical - This option is incorrect. The INTERSECT operator does not require the column names to be identical. It only requires that the number of columns and their data types are identical in all the SELECT statements.

Option D) The number of columns and data types must be identical for all SELECT statements - This option is correct. The INTERSECT operator requires that the number of columns and their data types are identical in all the SELECT statements. If the number of columns or their data types differ, an error will occur.

The correct answer is Option D. This option is correct because the number of columns and data types must be identical for all SELECT statements in the INTERSECT operation.

- Hide questions