Question: Analyze the code and show the output of this code. public class ClassA { public ClassA(){ System.out.print(Hello); } public void print (String name){ System.out.print(Hello
Analyze the code and show the output of this code.
public class ClassA { public ClassA(){ System.out.print("Hello"); } public void print (String name){ System.out.print("Hello " + name + " "); } public class Test{ public static void main(String[] args) { } } ClassA obj = new ClassA(); obj.print ("Bob");
Step by Step Solution
There are 3 Steps involved in it
Code Breakdown Classes 1ClassA ConstructorPrints Hello to the console Method printString name Prints ... View full answer
Get step-by-step solutions from verified subject matter experts
