0

programming languages Online Quiz - 298

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

Methods that work on the data are called accessor methods.

  1. True

  2. False


Correct Option: A

Methods that work on the data are called accessor methods.

  1. True

  2. False


Correct Option: A

4) JavaScript can only run on Windows

  1. True

  2. False


Correct Option: B

Which of the following is NOT a value type?

  1. Struct

  2. Delegate

  3. string

  4. Enumeration


Correct Option: C

Which of the following are true about Constructors?

  1. Member Function

  2. Same name as Class name

  3. Default constructor initializes all non-initialized fields and variables to zero.

  4. Compiler adds an empty constructor, if we do not write our own constructor


Correct Option: A,B,C,D

AI Explanation

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

Option A) Member Function - This option is correct. Constructors are special member functions in a class that are used to initialize objects of that class.

Option B) Same name as Class name - This option is correct. Constructors have the same name as the class they belong to.

Option C) Default constructor initializes all non-initialized fields and variables to zero - This option is correct. If a class does not have any constructor defined, the compiler adds a default constructor that initializes all non-initialized fields and variables to zero.

Option D) Compiler adds an empty constructor if we do not write our own constructor - This option is correct. If a class does not have any constructor defined, the compiler automatically adds an empty constructor (default constructor) to the class.

Therefore, all of the given options (A, B, C, D) are true about Constructors.

The correct answer is A, B, C, D.

Which is true about applet?

  1. Applet version has main method

  2. GUI components are added explicitly to the Applet

  3. Aplet class is declared private

  4. None of the above


Correct Option: D

JFC Stands for

  1. Java Foundation Course

  2. Java Fundamental Classes

  3. Java Foundation Classes

  4. None of the above


Correct Option: C

Java APIs are libraries of compiled code?

  1. True

  2. False


Correct Option: A

Which of the following is NOT a value type?

  1. Struct

  2. Delegate

  3. string

  4. Enumeration


Correct Option: C

A boolean in C# is

  1. BOOL

  2. bool

  3. Boolean

  4. boolean


Correct Option: A

True or False. Is Foo.Print() a valid statement? Given a class Foo and it has a function public void Print (); Foo f = new Foo (); Foo.Print ();

  1. True

  2. False


Correct Option: B

True or False. Like in C++, using exception does carry some performance penalty

  1. True

  2. False


Correct Option: B

Which of the following is jagged array creation?

  1. string [,,] aMatrix;

  2. string [][][] aMatrix;

  3. int [][]aInt= new int[3][];

  4. None of the above.


Correct Option: C

1) JavaScript is ...

  1. same as Java

  2. kind of like Java

  3. different than Java

  4. written part of Java


Correct Option: C

2) JavaScript is ...

  1. subjective

  2. objective

  3. evil

  4. object based


Correct Option: D

3) To comment out a line in JavaScript ...

  1. Precede it with two forward slashes, i.e. '//'

  2. Precede it with an asterisk and a forward slash, i.e. '*/'

  3. Precede it with an asterisk, i.e. '*'

  4. Precede it with a forward slash and an asterisk, i.e. '/*'


Correct Option: A

Methods that work on the data are called accessor methods.

  1. True

  2. False


Correct Option: A

Methods that work on the data are called accessor methods.

  1. True

  2. False


Correct Option: A

4) JavaScript can only run on Windows

  1. True

  2. False


Correct Option: B

Which of the following is NOT a value type?

  1. Struct

  2. Delegate

  3. string

  4. Enumeration


Correct Option: C
- Hide questions