What will be the result of executing the following code? 1. boolean a = true; 2. boolean b = false; 3. boolean c = true; 4. if (a == true) 5. if (b == true) 6. if (c == true) System.out.println("Some things are true in this world"); 7. else System.out.println("Nothing is true in this world!"); 8. else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false"); 9. else System.out.println("Hey this won't compile");
The code won't compile
"Some things are true in this world" will be printed
"Hey this won't compile" will be printed
None of these
What will be the result of executing the following code? // Filename; SuperclassX.java package packageX; public class SuperclassX { protected void superclassMethodX() { } int superclassVarX; } // Filename SubclassY.java 1. package packageX.packageY; 2. 3. public class SubclassY extends SuperclassX 4. { 5. SuperclassX objX = new SubclassY(); 6. SubclassY objY = new SubclassY(); 7. void subclassMethodY() 8. { 9. objY.superclassMethodX(); 10. int i; 11. i = objY.superclassVarX; 12. } 13. }
Compilation error at line 5
Compilation error at line 9
Runtime exception at line 11
What is displayed when the following code is compiled and executed? String s1 = new String("Test"); String s2 = new String("Test"); if (s1==s2) System.out.println("Same"); if (s1.equals(s2)) System.out.println("Equals");
Same
Equals
The code compiles, but nothing is displayed upon execution.
The code fails to compile
What will be output of this program? String str="TCS"; str.concat("Bangalore");
TCS
Bangalore
TCS Bangalore
Syntax Error
which class provides member functions for device-context operations, working with drawing tools, type-safe graphics device interface (GDI) object selection, and working with colors and palettes?
CDOCItem
CDC
CBrush
CAnimateCtrl
A ____________is a collection that associates a key object with a value object.
Array
List
Map
Vector
Useful Features of CObject classes are
serialization support
platform independent
object diagnostic output
run-time class information
The MFC library implements a Windows menu, from the Win32’s HMENU class, through the CMenu class
True
False
An application built on the framework can have multiple objects of a class derived from CWinApp.
The CPropertyPage class is declared in which header file?
afxdlg.h header file.
afxdlgs.h header file
afxprp.h header file
afxproppg.h header file