0

programming languages Online Quiz - 34

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

Do the list structure can have different data types ?

  1. True

  2. False


Correct Option: A

Do the negative indices are allowed in Python ?

  1. True

  2. False


Correct Option: A

Which is the following invalid structure/syntax in python ?

  1. list

  2. module

  3. sequence

  4. lib


Correct Option: D

Function definition in python prefix with _____ .

  1. function

  2. def

  3. void

  4. func


Correct Option: B

A class or a function definition in python ends with _____

  1. semicolon

  2. parentheses

  3. colon

  4. angle bracket


Correct Option: C

Identify the correct syntax for instantiating a class .

  1. testObj = CTest

  2. testObj = CTest()

  3. CTest testObj = CTest()

  4. testObj = new CTest()


Correct Option: B

Identify the correct syntax for instantiating a class .

  1. testObj = CTest

  2. testObj = CTest()

  3. CTest testObj = CTest()

  4. testObj = new CTest()


Correct Option: B

The constructor in python is _____

  1. def_init()

  2. name of class itself.

  3. python_init_

  4. init


Correct Option: D

How to initialize the variable with private scope ?

  1. Prefix the string 'private' to the variable name.

  2. initialize it with '_init_private'

  3. initialize it with double underscore '__'

  4. append the keyword 'pvt' before the variable.


Correct Option: C

What gets printed after this boolean b = false; if (b = true){ System.out.println("True"); }

  1. Prints "True"

  2. Prints nothing

  3. Prints false

  4. Error in if condition


Correct Option: A

What is "instanceOf" ?

  1. an operator

  2. a method

  3. nothing

  4. a keyword in Java


Correct Option: A

Methods which are marked as Protected can be accessed only by classes with in the same package?

  1. True

  2. False


Correct Option: B
  1. a match case is found

  2. a match case is found and break is encountered

  3. will continue till default

  4. none


Correct Option: B
- Hide questions