Java - Object-Oriented Programming Concepts
What will be the output of this Java code?
class Dog {
String name;
void bark() {
System.out.println(name + " barks");
}
}
public class Test {
public static void main(String[] args) {
Dog d = new Dog();
d.name = "Max";
d.bark();
}
}