programming languages Online Quiz - 300
Description: programming languages Online Quiz - 300 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);
What will happen when you attempt to compile and run the following code? (Assume that the code is compiled and run with assertions enabled.) public class AssertTest { public void methodA(int i) { assert i >= 0 : methodB(); System.out.println(i); } public void methodB() { System.out.println("The value must not be negative"); } public static void main(String args[]) { AssertTest test = new AssertTest(); test.methodA(-10); } }
What will happen when you attempt to compile and run the following code? interface MyInterface { } public class MyInstanceTest implements MyInterface { static String s; public static void main(String args[]) { MyInstanceTest t = new MyInstanceTest(); if(t instanceof MyInterface) { System.out.println("I am true interface"); } else { System.out.println("I am false interface"); } if(s instanceof String) { System.out.println("I am true String"); } else { System.out.println("I am false String"); } } }
What will happen when you attempt to compile and run the following code? public class Static { static { int x = 5; } static int x,y; public static void main(String args[]) { x--; myMethod(); System.out.println(x + y + ++x); } public static void myMethod() { y = x++ + ++x; } }
Given the following code, what will be the output? class Value { public int i = 15; } public class Test { public static void main(String argv[]) { Test t = new Test(); t.first(); } public void first() { int i = 5; Value v = new Value(); v.i = 25; second(v, i); System.out.println(v.i); } public void second(Value v, int i) { i = 0; v.i = 20; Value val = new Value(); v = val; System.out.println(v.i + " " + i); } }
What will be output of this program? String str="TCS"; str.concat("Bangalore");
A ____________is a collection that associates a key object with a value object.
The MFC library implements a Windows menu, from the Win32’s HMENU class, through the CMenu class