0

programming languages Online Quiz - 351

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

2.What is the correct JavaScript syntax to write "Hello World"?

  1. response.write("Hello World")

  2. document.write("Hello World")

  3. ("Hello World")

  4. "Hello World"


Correct Option: B
  1. for (i = 0; i <= 5; i++)

  2. for i = 1 to 5

  3. for (i <= 5; i++)

  4. for (i = 0; i <= 5)


Correct Option: A
  1. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

  2. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'

  3. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

  4. None of the above


Correct Option: C
  1. To retrieve data.

  2. To insert data.

  3. To modify data.

  4. All the above


Correct Option: B

The TRUNCATE TABLEā€¦?

  1. checks if the table has primary key specified

  2. deletes the table

  3. deletes all rows from a table

  4. None of the above


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) checks if the table has primary key specified - This option is incorrect. The TRUNCATE TABLE statement does not check if the table has a primary key specified. It is used to delete all rows from a table, regardless of the presence of a primary key.

Option B) deletes the table - This option is incorrect. The TRUNCATE TABLE statement does not delete the table itself. It only deletes all rows from the table, leaving the table structure intact.

Option C) deletes all rows from a table - This option is correct. The TRUNCATE TABLE statement is used to delete all rows from a table, effectively removing all data from it. This is different from the DELETE statement, which can be used to delete specific rows or a subset of rows based on certain conditions.

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

The correct answer is C) deletes all rows from a table. This option is correct because the TRUNCATE TABLE statement is specifically used for this purpose.

Java is a strongly-typed language

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of strongly-typed languages.

Option A) True - This option is correct. Java is indeed a strongly-typed language. In strongly-typed languages like Java, each variable must be declared with its data type, and the type of a variable cannot be changed after it is declared. This strict type checking ensures that variables are used in a consistent and predictable manner.

Option B) False - This option is incorrect. Java is a strongly-typed language, as explained above.

The correct answer is A) True. Java is a strongly-typed language because it requires explicit declaration of variable types and enforces strict type checking.

A single source file can contain multiple class definitions, each having any access modifier.

  1. True

  2. False


Correct Option: B

System class provides facilities to load files and libraries, and to create them.

  1. True

  2. False


Correct Option: B

All methods within a final class are implicitly final.

  1. True

  2. False


Correct Option: A
  1. SELECT, CONNECT, RESOURCE

  2. SELECT,INSERT,DELETE

  3. INSERT,DELETE,MODIFY,

  4. None Of The Above


Correct Option: A

Can a primary key contain more than one columns?

  1. True

  2. False


Correct Option: A
  1. DISTINCT

  2. UNIQUE

  3. DISTINCT and UNIQUE

  4. None Of The Above


Correct Option: A

Can we define exceptions twice in same block ?

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, we need to understand how exceptions are defined in programming.

In most programming languages, including Python, it is not possible to define the same exception twice within the same block. This is because an exception is typically defined as a class or object, and you cannot have two classes or objects with the same name within the same scope.

Therefore, the correct answer is B) False.

- Hide questions