Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following method: public void dosomething ( int [ ] a ) { a [ 2 ] = a [ 1 ] a [

Consider the following method:
public void dosomething(int[] a)
{
a[2]=a[1]
a[3]=a[2];
}
If a is declared as
int []a={1,2,3,4};
what are the values in a after dosomething (a) is called?
A.,1,2,3,4
B.,1,1,2,4
f.1,2,2,3
O.1,2,2,2
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions