MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to? |
| A. | Octal |
| B. | Bignum |
| C. | Fixnum |
| D. | Binary |
| E. | |
| Answer» D. Binary | |
| 2. |
my_string=Rubyputs(my_string)19.Which type of number(0b1011 ) is ? |
| A. | Octal |
| B. | Hexadecimal |
| C. | Binary |
| D. | Decimal |
| Answer» D. Decimal | |
| 3. |
Why can not we use quotation marks ("or") with boolean? |
| A. | It indicates that we are talking about a string |
| B. | It indicates that we are assining a value |
| C. | It indicates that that we are replacing boolean data type with string data type |
| D. | None of the above |
| Answer» B. It indicates that we are assining a value | |
| 4. |
Why notation is used in Ruby? |
| A. | Formfeed |
| B. | Escape |
| C. | Carriage return |
| D. | Bell |
| Answer» D. Bell | |
| 5. |
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 |
| Answer» B. _CURRENT_ | |
| 6. |
Constants in ruby begin with ? |
| A. | Lowercase |
| B. | ! |
| C. | ! |
| D. | Uppercase |
| Answer» E. | |
| 7. |
Default value of class variables is? |
| A. | nil |
| B. | infinite |
| C. | -1 |
| D. | error |
| Answer» E. | |
| 8. |
Class variables in ruby begin with? |
| A. | @ |
| B. | # |
| C. | double @ |
| D. | ## |
| Answer» D. ## | |
| 9. |
Instance variables in ruby begin with? |
| A. | @ |
| B. | # |
| C. | $ |
| D. | & |
| Answer» B. # | |