Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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; xStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started