From line 13 where does the flow control of program moves why and how?
Line no 19 println(cat.name) which name it is refering to
name at line 9 11 or 13?
package com.codegym.task.task04.task0403;
/*
What's the cat's name?
*/
public class Cat {
private String name = "nameless cat";
public void setName(String name) {
//write your code here
this.name="Simba";
}
public static void main(String[] args) {
Cat cat = new Cat();
cat.setName("Simba");
System.out.println(cat.name);
}
}