Question: Calling a String from an Array Okay I'm not sure how I can call the length of the string inside the arrays. For instance I


Calling a String from an Array
Okay I'm not sure how I can call the length of the string inside the arrays. For instance I want the output to read like this:

The UML says there is a getLength method in the Cake class but for some reason I can't call it by using Cake.getLength() (I was not given access to the source file)

public class Testcake public static void main (String] args) { Cake[] myCake = new Cake[4]; nyCake[0] = new Cake ( "Hello my friend." ); myCake [1] = new Cake ( "How are you? " ); myCake[2] = new Cake ( ); myCake[3] = new Cake ( "Have a great one!" ); for ( int x = 0; x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
