0

programming languages Online Quiz - 315

Description: programming languages Online Quiz - 315
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

which characteristics can be set at design time using the Style property of dialog box?

  1. child

  2. popup

  3. Overlapped

  4. Borders


Correct Option: A,B,C

What does SAS stands for?

  1. Statistical Analyst System

  2. Statistical Analytical System

  3. Statistical Analysis System

  4. Statistical Analysis Software


Correct Option: C

If you are using the CFrameWnd::Create() method to create the window, you can specify the name of the menu using which argument.

  1. MenuCaption argument

  2. lpszMenuName argument

  3. MenuName argument

  4. splzMenuName argument


Correct Option: B

If you miss RUN; what happens?

  1. gives an abend

  2. gives an error

  3. no error

  4. complier ignores


Correct Option: C

Which of the following resources is invalid?

  1. Dialog box

  2. Tree view

  3. Property Sheet

  4. Menu


Correct Option: B,C

A property page is a dialog box, that can be positioned in front of, or behind of, another.

  1. True

  2. False


Correct Option: A

A property page is designed from a dialog box and it has which of the following characteristics?

  1. Visible

  2. Enable

  3. TitleBar

  4. Border


Correct Option: A,C,D

Which option is used to over ride the default nature of input statement, to read only required amount of data?

  1. TRUNCOVER

  2. MISSOVER

  3. FLOWOVER

  4. LOST CARD


Correct Option: A

Memory is a type of Device Context.

  1. True

  2. False


Correct Option: A

Which is not one of the input statement format?

  1. input (height weight) 2. ;

  2. input age weight gender $;

  3. input height 1-3 weight 4-6 gender 7;

  4. input @1 height 2. @4 weight 2. @7 gender $1;


Correct Option: A

which is the Parent class of CWinApp?

  1. CWnd

  2. CFrameWnd

  3. CObject

  4. CWinThread


Correct Option: D

When a user changes the content of one of the views, that view object calls which of the following function?

  1. CDocument::UpdateViews

  2. CDocument::UpdateAllViews

  3. CDocument::UpdateData(TRUE)

  4. CDocument::Modify(TRUE)


Correct Option: B

Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.

  1. public static int main(char args[])

  2. public static void main(String args[])

  3. public static void MAIN(String args[])

  4. public static void main(String args)

  5. public static void main(char args[])


Correct Option: B

AI Explanation

To answer this question, you need to understand the correct syntax for the main method in Java.

The main method is the entry point for a Java program. It is the method that is executed when the program is started. The correct declaration for the main method is:

Option B) public static void main(String args[])

Explanation for each option:

Option A) public static int main(char args[]) - This option is incorrect because the return type of the main method should be void, not int.

Option B) public static void main(String args[]) - This option is correct because it has the correct syntax for the main method. The main method must be declared as public, static, void, and must accept a single parameter of type String array.

Option C) public static void MAIN(String args[]) - This option is incorrect because the main method must be declared as "main", not "MAIN". Java is case-sensitive, so the method name must match exactly.

Option D) public static void main(String args) - This option is incorrect because the main method should accept a parameter of type String array, not a single String.

Option E) public static void main(char args[]) - This option is incorrect because the main method should accept a parameter of type String array, not a char array.

Therefore, the correct answer is B) public static void main(String args[]).

What all gets printed when the following code is compiled and run? Select the three correct answers. public class xyz { public static void main(String args[]) { for(int i = 0; i < 2; i++) { for(int j = 2; j>= 0; j--) { if(i == j) break; System.out.println("i=" + i + " j="+j); } } } }

  1. i=0 j=0

  2. i=0 j=1

  3. i=0 j=2

  4. i=1 j=0

  5. i=1 j=1

  6. i=1 j=2


Correct Option: B,C,F

which view class allows usage of document - view architecture with tree, list, and rich edit controls?

  1. CScrollView

  2. CListView

  3. CRichEditView

  4. CCtrlView


Correct Option: D

The principal base class for the Microsoft Foundation Class Library is

  1. CMenu

  2. CWnd

  3. CObject

  4. CWinApp


Correct Option: C

Which of the following is true. Select the correct answers.

  1. A class that is abstract may not be instantiated.

  2. The final keyword indicates that the body of a method is to be found elsewhere. The code is written in non-Java language, typically in C/C++.

  3. A static variable indicates there is only one copy of that variable.

  4. A method defined as private indicates that it is accessible to all other classes in the same package.


Correct Option: A,C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A class that is abstract may not be instantiated. - This option is correct. In Java, an abstract class cannot be instantiated directly. It can only be used as a superclass for other classes, which can then be instantiated.

Option B) The final keyword indicates that the body of a method is to be found elsewhere. The code is written in non-Java language, typically in C/C++. - This option is incorrect. The final keyword in Java is used to indicate that a method, variable, or class cannot be overridden, modified, or extended, respectively.

Option C) A static variable indicates there is only one copy of that variable. - This option is correct. A static variable in Java is associated with the class, not with an instance of the class. This means that there is only one copy of the static variable, regardless of how many objects of the class are created.

Option D) A method defined as private indicates that it is accessible to all other classes in the same package. - This option is incorrect. A method defined as private in Java is only accessible within the same class, not to other classes, even if they are in the same package.

The correct answers are A and C. Option A is correct because an abstract class cannot be instantiated. Option C is correct because a static variable indicates there is only one copy of that variable.

Therefore, the correct answer is A, C.

Which of the following are legal array declarations.

  1. int i[5][];

  2. int i[][];

  3. int []i[];

  4. int i[5][5];

  5. int[][] a;


Correct Option: B,C,E

In Win32, an application is created by a call to

  1. Main()

  2. WinMain()

  3. InitInstance()

  4. OnEXecute()


Correct Option: B

Which of the following statements related to Garbage Collection are correct.

  1. It is possible for a program to free memory at a given time.

  2. Garbage Collection feature of Java ensures that the program never runs out of memory.

  3. It is possible for a program to make an object available for Garbage Collection.

  4. The finalize method of an object is invoked before garbage collection is performed on the object.


Correct Option: C,D
- Hide questions