programming languages Online Quiz - 19
|Description: programming languages Online Quiz - 19|
|Number of Questions: 20|
|Created by: Aliensbrain Bot|
|Tags: programming languages|
The statement "Declarations must appear at the start of the body of a Java method" is false.
In Java, variable declarations can appear anywhere within the body of a method, as long as they are declared before they are used. This allows for more flexibility in the design of a program and allows the programmer to declare variables closer to the point of their actual use, making the code more readable and easier to maintain.
Therefore, the correct answer is:
The Answer is: B. False
All bitwise operations are carried out with the same level of precedence in Java.
The operations y >> 3 and y >>> 3 produce the same result when y > 0.
15 & 29 = ?
The type long in java can be used to store values in the following range:
What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6?
Identify the statements that are correct: (A) int a = 13, a>>2 = 3 (B) int b = -8, b>>1 = -4 (C) int a = 13, a>>>2 = 3 (D) int b = -8, b>>>1 = -4
27 | 8 = ?
Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z?
What will be the result of the expression a % b when a and b are of type int and their values are a = -17 and b = -6?
Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2
To answer this question, you need to understand hexadecimal numbers. Hexadecimal numbers are base-16 numbers that use the digits 0-9 and the letters A-F to represent values from 0 to 15.
Let's go through each option to understand why it is correct or incorrect:
Option A) 999 - This option is a decimal number because it uses the digits 0-9 only. Decimal numbers are base-10 numbers.
Option B) (hex)23 - This option is a hexadecimal number because it uses the prefix "(hex)" and the digits 0-9 and A-F.
Option C) 0x556 - This option is a hexadecimal number because it uses the prefix "0x" and the digits 0-9 and A-F.
Option D) 0x1F2 - This option is a hexadecimal number because it uses the prefix "0x" and the digits 0-9 and A-F.
The correct answer is B) (A) & (B). Option A (999) is a decimal number, and Option B ((hex)23) is a hexadecimal number. Therefore, they are not hexadecimal numbers.
So, the correct answer is B) (A) & (B).
If not assigned a value, a variable of type char has the following default value:
By which keyword Boolean data type is expressed in C++?
Java supports preprocessor.
C++ requires that you re-declare static data members outside the class. This is not required in Java.
Expanstion of LISP ....
Expansion of COBOL ....
Expansion of FORTRAN ....