What will the following code print out? public class NamePrinter { public void printName(String name) { System.out.println("Your name is: " + name); } public void printAge(int age) { System.out.println("Your age is: " + age); } public static void main(String[] args) { NamePrinter np = new NamePrinter(); np.printName("John"); np.printAge(32); } }




© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.