11. What does the join method do when used with an array in Ruby? A. Joins all elements into a single string B. Splits the array into multiple strings C. Combines two arrays D. Sorts the elements of the array Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
12. What does the keys method return when called on a hash in Ruby? A. Array of all keys B. Array of all values C. Array of key-value pairs D. Number of keys in the hash Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
13. What is the output of "hello".length in Ruby? A. 5 B. 6 C. "hello" D. 4 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
14. Which method is used to check if an array includes a specific element in Ruby? A. include? B. contains? C. has_element? D. exists? Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
15. What is the output of ["apple", "banana", "cherry"].join(", ") in Ruby? A. "apple, banana, cherry" B. ["apple", "banana", "cherry"] C. "applebanana cherry" D. ["apple, banana, cherry"] Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. In Ruby, which method is used to remove the last element from an array and return it? A. pop B. remove C. delete D. shift Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
17. What does the '<<' operator do when used with arrays in Ruby? A. Adds an element to the beginning of the array B. Adds an element to the end of the array C. Removes the last element from the array D. Concatenates two arrays Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
18. Which method in Ruby is used to check if a key exists in a hash? A. key? B. include? C. exists? D. has_key? Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
19. In Ruby, which method is used to add a key-value pair to a hash? A. add B. insert C. push D. store Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
20. What is the result of the expression `"hello".split` in Ruby? A. ["h", "e", "l", "l", "o"] B. ["hello"] C. Error D. "hello" Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board