Home / MCQ Bank / Computer
Computer Interfaces And Abstract Classes

What will be the output of the following Java code? class isinfinite_output { public static void main(String args[]) { Double d = new Double(1 / 0.); boolean x = d.isInfinite(); System.out.print(x); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • true

Related Computer Questions

Information travels between components on the mother board through- Correct code to turn assertions OFF at various places throughout a source file is ______ In Ruby, what does it mean to "freeze" an object? What are the formal parameters in C++? What will be the output of the following C++ code? #include <iostream> using namespace std; class sample { public: int x, y; sample() {}; sample(int, int); sample operator + (sample); }; sample::sample (int a, int b) { x = a; y = b; } sample sample::operator+ (sample param) { sample temp; temp.x = x + param.x; temp.y = y + param.y; return (temp); } int main () { sample a (4,1); sample b (3,2); sample c; c = a + b; cout << c.x << "," << c.y; return 0; }