Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10. What's wrong with the following code segment? int i,j; String[] names; names[0] = new String(mary); names[1] = john; i = j = names.length;

 

10. What's wrong with the following code segment? int i,j; String[] names; names[0] = new String("mary"); names[1] = "john"; i = j = names.length; names[0].length();

Step by Step Solution

There are 3 Steps involved in it

Step: 1

int ij String names declaration of array names0 new Stringmary initialisation and assigning values s... 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_2

Step: 3

blur-text-image_3

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

International Finance Putting Theory Into Practice

Authors: Piet Sercu

1st edition

069113667X, 978-0691136677

More Books

Students also viewed these Programming questions

Question

Find the distribution of the sum X 1 +X 2 of independent r.v.s

Answered: 1 week ago