Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1 In java, an array can contain several types of elements True or False

ID: 3876631 • Letter: Q

Question

Question 1
In java, an array can contain several types of elements

True or False ?


Question 2
All operators in java have the same precedence

True or False ?


Question 3

int computeValue (int x, int y)
is a function which receives 2 parameters x and y, passed by reference

True or False ?


Question 4

There are 3 main logical operators in java:
&& (AND), || (OR), and ! (NOT)

True or False ?


Question 5

In java, when passing an entire array to a function as an argument, the default passing mechanism is by reference

True or False ?


Question 6

According to De Morgan's law,
!(A || B) is equivalent to !A || !B
Where ! means NOT and || means OR

True or False ?


Question 7

In Java, variable names are case sensitive, so myName is not the same as mynamE.

True or False ?


Question 8

When writing
Variable1 = Variable2, the content of Variable2 gets copied in Variable1.

True or False ?


Question 9

int computeValue (int x, int y)
is a function which returns an integer

True or False ?


Question 10

int computeValue (int x, int y)
is a function which receives 2 parameters x and y, passed by value

True False ?


Question 11

In Java, it is possible to have two functions by the same name as long as

1. they don't have the same number of parameters ?

3. The parameter list is not identical ?

4. They don't return the same type of value ?

5. Any of the above is true ?


Question 12

(a || b && c) is equivalent to


1. a || (b &&c) ?

2. (a || b) && c ?

3. why bother, it is all the same anyways?


Question 13

In java, Variable1 = Variable2 is the same as
Variable1 == Variable2

True or False ?


Question 14

in the following code:
int[] list = {1, 2, 3, 4, 1, 2, 3};

list[1] contains


options:

1?

2?

3?

4?


Question 15

int[][][] myArray = new int[2][3][4];

creates an array of


1. 24 integers ?

2. 24 elements, some of which are integers ?

3. 12 integers ?

4. 12 elements, some of which are integers ?


Question 16

According to De Morgan's law,
!(A && B) is equivalent to !A && !B
Where ! means NOT, && means AND and || means OR


True or False ?

Question 17

Is a set of rules which simplify complex logical equations

True or False ?


Question 18

In Java, && gets evaluated before ||

True or False ?


Question 19

When writing
Variable1 = Variable2,
the contents of Variable2 are tested against the contents of Variable1;
If they are equal, then the evaluation will yield true, otherwise it will yield false

True or False ?


Question 20

in the following code:
int myVal = computeValue(2, 3);

int computeValue (int x, int y) {
    int result = x+y;
    return result;
}

int myVal = computeValue(2, 3);
is


1. a parameter ?

2. A function call ?

3. the function body ?

4. the header of the function computeValue ?

PLEASE ANSWER ALL

Explanation / Answer


Question 1
In java, an array can contain several types of elements

False, because array is collection of similar objects or datatype.


Question 2
All operators in java have the same precedence


No, as you know mul have higher precedence than addition


Question 3

int computeValue (int x, int y)
is a function which receives 2 parameters x and y, passed by reference

No, Since they are primitive data type, they are passed as value

Question 4

There are 3 main logical operators in java:
&& (AND), || (OR), and ! (NOT)

True

Question 5

In java, when passing an entire array to a function as an argument, the default passing mechanism is by reference

True

Question 6

According to De Morgan's law,
!(A || B) is equivalent to !A || !B
Where ! means NOT and || means OR

False. It is !A && !B


Question 7

In Java, variable names are case sensitive, so myName is not the same as mynamE.

True


Question 8

When writing
Variable1 = Variable2, the content of Variable2 gets copied in Variable1.

True


Question 9

int computeValue (int x, int y)
is a function which returns an integer

True


Question 10

int computeValue (int x, int y)
is a function which receives 2 parameters x and y, passed by value

True


Question 11


In Java, it is possible to have two functions by the same name as long as


3. The parameter list is not identical ?



Question 12

(a || b && c) is equivalent to


1. a || (b &&c)

Question 13

In java, Variable1 = Variable2 is the same as
Variable1 == Variable2

False, == actually checks shallow equality


Question 14

in the following code:
int[] list = {1, 2, 3, 4, 1, 2, 3};

list[1] contains


options:
2


Question 15

int[][][] myArray = new int[2][3][4];

creates an array of


1. 24 integers

Question 16

According to De Morgan's law,
!(A && B) is equivalent to !A && !B
Where ! means NOT, && means AND and || means OR


Fals, it is !A || !B





Question 17

Is a set of rules which simplify complex logical equations

Question missing


Question 18

In Java, && gets evaluated before ||

True


Question 19

When writing
Variable1 = Variable2,
the contents of Variable2 are tested against the contents of Variable1;
If they are equal, then the evaluation will yield true, otherwise it will yield false

Fals, as already said, it copies


Question 20

in the following code:
int myVal = computeValue(2, 3);

int computeValue (int x, int y) {
   int result = x+y;
   return result;
}

int myVal = computeValue(2, 3);
is

2. A function call

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote