Select the correct option to test your answer:
Computer
Constructors And Methods
Difficulty: Medium
What is the expected output? public class Profile { private Profile(int w) { // line 1 System.out.print(w); } public static Profile() { // line 5 System.out.print (10); } public static void main(String args[]) { Profile obj = new Profile(50); } }
More Computer Questions
What will be the output of the following C++ code? #include <iostream> using namespace std; int main () { int n; for (n = 5; n > 0; n--) { cout << n; if (n == 3) break; } return 0; }
What will be the output of the following C# code snippet? class Output { public static void main(String args[]) { try { int a = 0; int b = 5; int c = a / b - 5; Console.WriteLine("C"); } finally { Console.WriteLine("sharp"); } } }
Which of the following is not the user file extension?
What is the purpose of a pure virtual function in C++?
Which keyword is used to create a new instance of a class in Ruby?