Câu hỏi phỏng vấn Ruby
Câu hỏi

Is everything in Ruby an object?

Câu trả lời

In Ruby, not everything is an object. While Ruby is known for its pure object-oriented approach where many elements like strings, arrays, and even classes are objects, there are exceptions. Specifically, methods, blocks, and keywords are not objects in Ruby. However, it is important to note that there are Method objects and Proc objects available, which can encapsulate methods and blocks respectively[3]. This distinction is crucial in understanding Ruby's object model and its capabilities.

Citations:
[1] https://www.turing.com/inte...

entry

entry

Gợi ý câu hỏi phỏng vấn

middle

What are some disadvantages of a case statement versus repeated elsif
statements?

middle

What is the difference between throw/catch and raise/rescue ?

middle

How is the invocation of a private method different than the invocation of a public method from within its
defining class?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào