0

programming languages Online Quiz - 133

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

Which of the following cannot be used as a modifier for instance variables while defining a class?

  1. Synchronized

  2. Native

  3. Strictfp

  4. All of these


Correct Option: D

What is the output of the program?

  1. 100

  2. Run time Exception. A final object cannot be changed

  3. Compilation Error. A final object cannot be changed

  4. Compilation Error: There cannot be any final objects in a method


Correct Option: A

What is the output of the program?

  1. Compilation fails

  2. 100

  3. RunTime Exception

  4. 0


Correct Option: A

What is the output of the program?

  1. Blue

  2. 2

  3. Runtime Exception

  4. Compilation Error


Correct Option: D

can versioning concept applicable to Private assemblies?

  1. True

  2. False


Correct Option: B

Does XML replace HTML?

  1. True

  2. False


Correct Option: B

Does XML replace HTML?

  1. True

  2. False


Correct Option: B

What is the basic objects of data dictionary?

  1. Domain

  2. Documentation

  3. Data Models

  4. Dynpro


Correct Option: A

Data element is an example of

  1. Physical definitions

  2. Business object

  3. Semantic Domain

  4. Technical Domain


Correct Option: C

Which data type cannot be used to define parameters

  1. Type N

  2. Type C

  3. Type F

  4. Type P


Correct Option: C

What is the system field for the current date?

  1. SY-DATUM

  2. SY-DATID

  3. SY-DATE

  4. SY-SDATE


Correct Option: A

Which of the following describe the internal representation of a type D data?

  1. DDMMYYYY

  2. YYYYDDMM

  3. MMDDYYYY

  4. YYYYMMDD


Correct Option: D

If a table doesn't have MANDT as part of the primary key, it is

  1. a structure

  2. invalid

  3. client-independent

  4. not mandatory


Correct Option: C

Within the source code of a function module errors are handled via the keyword.

  1. Exception

  2. Raise

  3. Stop

  4. Abend


Correct Option: A

AI Explanation

To answer this question, you need to understand error handling in function modules.

Option A) Exception - This option is correct. In the source code of a function module, errors are handled using the keyword "EXCEPTION". This keyword is used to define specific exceptions that can occur during the execution of the function module. When an exception occurs, the program flow jumps to the corresponding exception block to handle the error.

Option B) Raise - This option is incorrect. The keyword "RAISE" is used to raise an exception in ABAP programming. It is not specifically used for error handling in function modules.

Option C) Stop - This option is incorrect. The keyword "STOP" is used to terminate the execution of a program or function module. It is not used for error handling.

Option D) Abend - This option is incorrect. The term "ABEND" stands for "Abnormal End". It is used to describe a situation where a program or system terminates abnormally. It is not a keyword used for error handling in function modules.

The correct answer is Option A) Exception. This option is correct because the keyword "EXCEPTION" is used to handle errors in the source code of a function module.

Which dictionary structure contains system fields?

  1. SYSTEM

  2. SYST

  3. SYS

  4. SYTAB

  5. SY


Correct Option: B

Which system field returns the number of records returned after a select?

  1. SY-INDEX

  2. SY-DBCNT

  3. SY-RECNO

  4. SY-TABIX

  5. SY-LNCNT


Correct Option: B

How many types of tables exists in data dictionary? a) Transparent Table b) Internal Table c) Pool Table d) Hash Table e) Cluster Table f) Master Data Table

  1. a,c & e

  2. a,d & e

  3. a,b & c

  4. All the above


Correct Option: A

Class C { public static void main(String[] args) { int[]a1[]=new int[3][3]; //3 int a2[4]={3,4,5,6}; //4 int a2[5]; //5 }} What is the result of attempting to compile and run the program ?.

  1. compiletime error at lines

  2. compiltime error at line 4,5

  3. compiletime error at line 3

  4. Runtime Exception

  5. None of the above


Correct Option: B

interface I{ void f1(); // 1 public void f2(); // 2 protected void f3(); // 3 private void f4(); // 4 } which lines generate compile time errors?

  1. compiletime error at lines 1,2,3,4

  2. compiletime error at line 3

  3. compiletime error at line 1

  4. compiletime error at lines 3,4

  5. None of the above


Correct Option: D
Explanation:

To solve this question, the user needs to know about the different access modifiers in Java and their effect on the accessibility of methods.

Option A: This option is incorrect. There should be no compile-time errors in the code as all the methods in the interface are correctly defined.

Option B: This option is incorrect. The protected access modifier can be used in interface methods, so there should be no compile-time error at line 3.

Option C: This option is incorrect. The default access modifier can be used in interface methods, so there should be no compile-time error at line 1.

Option D: This option is correct. The private access modifier cannot be used in interface methods as they are implicitly abstract and intended to be implemented by other classes. Thus, there is a compile-time error at line 4. Additionally, the protected access modifier can be used in interface methods, but it may cause issues with implementation, so it is not recommended.

Option E: This option is incorrect. The correct answer is option D.

Therefore, the answer is: D. compiletime error at lines 3,4.

  1. compiletime error at lines 1,2,3,4,5

  2. compiletime error at lines 2,3,4,5

  3. compiletime error at lines 2,3,4

  4. prints 3

  5. None of the above


Correct Option: B
- Hide questions