adplus-dvertising
frame-decoration

Question

Given the array of integers ‘array’ shown below.

What is the output of the following JAVA statements?

int [ ] p = new int [10];
int [ ] q = new int [10];
for (int k = 0; k < 10; k ++)
p[k] = array [k];
q = p;
p[4] = 20;
System.out.println(array [4] + “:” + q[4]);

a.

20:20

b.

18:18

c.

18:20

d.

20:18

Answer: (c).18:20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Given the array of integers ‘array’ shown below. What is the output of the following JAVA statements? int [ ] p = new int [10]; int [ ] q = new int [10]; for (int k = 0; k...

Similar Questions

Discover Related MCQs

Q. Consider the following JAVA program:

public class First {
public static int CBSE (int x) {
if (x < 100) x = CBSE (x +10);
return (x - 1);
}
public static void main (String[] args){
System.out.print(First.CBSE(60));
}
}

What does this program print?

Q. What can you say about the following statements?

I. XML tags are case-insensitive.
II. In JavaScript, identifier names are case-sensitive.
III. Cascading Style Sheets (CSS) cannot be used with XML.
IV. All well-formed XML documents must contain a document type definition.

Q. ................. is subject oriented, integrated, time variant, non-volatile collection of data in support of management decisions.

Q. In Data mining, classification rules are extracted from ..............

Q. Discovery of cross sales opportunities is called as ...............

Q. In Data mining, .............. is a method of incremental conceptual clustering.

Q. Match the following with reference to Functional programming history:

a. Lambda calculus                             i. Church, 1932
b. Lambda calculus as
programming language                      ii. Wordsworth, 1970
c. Lazy evaluation                               iii. Haskel, 1990
d. Type classes                                    iv. Mecarthy, 1960

Codes :
      a   b   c    d

Q. Aliasing in the context of programming languages refers to:

Q. Which of the following is not used in standard JPEG image compression?

Q. Which of the following is a source coding technique?

Q. If the histogram of an image is clustered towards origin on X-axis of a histogram plot then it indicates that the image is .............

Q. Which of the following statements is incorrect for a Windows Multiple Document Interface (MDI)?

Q. The region of feasible solution of a linear programming problem has a ............... property in geometry, provided the feasible solution of the problem exists.

Q. Consider the following statements:

(a) Revised simplex method requires lesser computations than the simplex method.
(b) Revised simplex method automatically generates the inverse of the current basis matrix.
(c) Less number of entries are needed in each table of revised simplex method than usual simplex method.

Which of these statements are correct?

Q. Which of the following is characteristic of an MIS?

Q. ................. system is market oriented and is used for data analysis by knowledge workers including Managers, Executives and Analysts.

Q. .................. allows selection of the relevant information necessary for the data warehouse.

Q. ................. uses electronic means to transfer funds directly from one account to another rather than by cheque or cash?

Q. As compared to rental and leasing methods to acquire computer systems for a Management Information System (MIS), purchase method has following advantage :

Q. Consider the conditional entropy and mutual information for the binary symmetric channel. The input source has alphabet X={0,1} and associated probabilities {1/2,1/2}. The channel matrix is as shown below, where p is the transition probability. Then the conditional entropy is given by :