Home / MCQ Bank / Computer
Computer Classes And Objects In Ruby Difficulty: Medium

What is the method used to define a class method in Ruby?

Select the correct option to test your answer:

More Computer Questions

The main difference between TCP and UDP is What will be the output of the following C++ code? #include <iostream> using namespace std; int gcd (int a, int b) { int temp; while (b != 0) { temp = a % b; a = b; b = temp; } return(a); } int main () { int x = 15, y = 25; cout << gcd(x, y); return(0); } Whose value targets CSS property? What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; int main () { string str="Steve Jobs founded the apple"; string str2 = str.substr (6, 4); unsigned pos = str.find("the"); string str3 = str.substr (pos); cout << str2 << ' ' << str3 << '\n'; return 0; } What will be the output of the following C# code? class box { public int volume; int width; int height; int length; public box ( int w, int h, int l) { width = w; height = h; length = l; } public ~box() { volume = width * length * height; } } class Program { static void Main(string[] args) { box b = new box(4, 5, 9); Console.WriteLine(b.volume); Console.ReadLine(); } }