You have a file Cat.java and you have a driver class named D…
You have a file Cat.java and you have a driver class named Driver.java. Fill in the correct visibility modifiers so that the comments in the main method are upheld. public class Driver { public static void main(String[] args) { Cat t = new Cat(); // each of the lines below is run independently System.out.println(t.age); // compiles and runs System.out.println(t.isKitten); // compiles and runs System.out.println(t.getIsKitten()); // compile error } } —— in a separate file in a different package/directory ——— public class Cat { 1 int age; 2 boolean isKitten; 3 boolean getIsKitten() { return isKitten; } /** no-argument constructor implemented **/ } 1 :[vis1] 2 :[vis2] 3 :[vis3]
Read Details