Advertisement Remove all ads

Consider the Following String Array and Give the Output String Arr= {“Delhi”, “Chennai”, “Mumbai”, “Lucknow”, “Jaipur”}; - Computer Applications

Advertisement Remove all ads
Advertisement Remove all ads
One Line Answer

Consider the following String array and give the output 

String arr[]= {“DELHI”, “CHENNAI”, “MUMBAI”, “LUCKNOW”, “JAIPUR”};

System.out.println(arr[0] .length( )> arr[3] .length( );

System.out.print(arr[4] ,substring(0,3));

Advertisement Remove all ads

Solution

false (at index 0, DELHI consists of 5 characters, at index 3, LUCKNOW consists of 7 characters. Therefore 5 > 7 is false)
JAI (at index 4, JAIPUR exists and extract its three characters)

Concept: String Array
  Is there an error in this question or solution?
Advertisement Remove all ads
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×