Home / Programming Questions / Ruby MCQs / Page 4

Ruby MCQs with answers Page - 4

Dear candidates you will find MCQ questions of Ruby here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Default value of class variables is?

(A) nil
(B) infinite
(C) -1
(D) error

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Local variables in ruby begin with?

(A) @
(B) _
(C) *
(D) #

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Constants in ruby begin with ?

(A) Lowercase
(B) @
(C) !
(D) Uppercase

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which of the following Ruby Pseudo-Variables is used for The receiver object of the current method?

(A) self
(B) current
(C) nil
(D) _FILE_

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which of the following Ruby Pseudo Variables is used to return the name of the current source file?

(A) _FILE_
(B) _CURRENT_
(C) _LINE_
(D) None of the above

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which of the following Ruby Pseudo Variables is used to return current line number in the source file?

(A) _FILE_
(B) _CURRENT_
(C) _LINE_
(D) None of the above

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Why notation is used in Ruby?

(A) Formfeed
(B) Escape
(C) Carriage return
(D) Bell

V

Vinay Kumar • 8.45K Points
Tutor III

Q. Which notation is used for Octal notation?

(A) \s
(B) \xnn
(C) \n
(D) \nn

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.