Go Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Go. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Does Go support type inheritance?

A - yes

B - no

Answer : B

Explanation

No support for type inheritance.

Q 2 - Which of the following is a derived type in Go?

A - Pointer types

B - Array types

C - Structure types

D - All of the above.

Answer : D

Explanation

All of the above are derived types.

Answer : A

Explanation

If you are using nested loops (i.e., one loop inside another loop), the break statement will stop the execution of the innermost loop and start executing the next line of code after the block.

Q 5 - Which of the following is the default value of a local variable in Go?

A - Undefined

B - 0 or nil

C - Not fixed

D - None of the above.

Answer : B

Explanation

Default value of a local variable is 0 type value or nil.

Q 6 - Which of the following function can be used to increase the capacity of a slice in Go?

A - append()

B - copy()

C - resize()

D - None of the above.

Answer : A

Explanation

Slice allows increasing the capacity of a slice using append() function.

Q 8 - Go supports method overloading.

A - true

B - false

Answer : B

Explanation

No support for method overloading.

Q 9 - In Go language, Pointer types are derived types.

A - false

B - true

Answer : B

Explanation

Yes! Pointer types are derived types.

Q 10 - The term rvalue refers to a data value that is stored at some address in memory.

A - true

B - false

Answer : A

Explanation

The term rvalue refers to a data value that is stored at some address in memory.

go_questions_answers.htm
Advertisements