Ask coding questions

← Back to all posts
toyStore
studentSakethSa (1)

i can not get what wrong i this code can tell that the problem in this code

Comments
hotnewtop
Coder100 (17136)

Problem

Your signature is wrong. The Toy class requires a string, not multiple strings.

Solution

	public void loadToys( String[] toys )
	{
for (String toy : toys) {
   toyList.add(new Toy(toy));
} 
	}