ExamVeda
Login
Home
11
Which of the following is used to define a class method in Ruby?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
12
What is the purpose of the `attr_accessor` method in Ruby?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
13
In Ruby, which method is called automatically when an object is created?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
What does the def keyword signify in Ruby?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
15
In Ruby, which keyword is used to call a method?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
16
What does the return keyword do in Ruby methods?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
17
What is the purpose of the initialize method in Ruby classes?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
18
Which of the following is NOT a valid method definition syntax in Ruby?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
19
What is the result of calling a method in Ruby without parentheses?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
20
In Ruby, which method is used to define a getter and setter for an instance variable?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board