• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
What is the syntax for defining a method in Ruby?
روبی میں طریقہ کی وضاحت کے لیے نحو کیا ہے؟
  1. def method_name
  2. method method_name
  3. function method_name
  4. define method_name
Explanation

In Ruby, the syntax for defining a method is:

def method_name(parameters)

  # method body

end

The 'def' keyword is used to define a method, followed by the method name and parameters in parentheses.

The method body is indented and enclosed by the 'end' keyword.

Related MCQs

  1. 5
  2. 8
  3. SyntaxError
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

حروف، اعداد اور خاص علامات پر مشتمل پاس ورڈ زیادہ مضبوط کیوں سمجھا جاتا ہے؟
  1. It reduces password length
  2. It increases possible combinations
  3. It is easier to remember
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

  1. Input → Processing → Output → Storage
  2. Processing → Input → Storage → Output
  3. Storage → Input → Processing → Output
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

ڈبل انڈر لائن کے لیے شارٹ کٹ کی کیا ہے؟
  1. Ctrl + Shift + D
  2. Ctrl + Ctrl + Shift + B
  3. Ctrl + Ctrl + Shift + U
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

سنٹرل پروسیسنگ یونٹ کس کام کا ذمہ دار ہے؟
  1. Processing instructions and calculations
  2. Displaying images and associated text
  3. Typing input for processing
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com