0

I am not getting answer to this particular question

Hey guys. I am just about to finish my java introduction course. but I am not able to solve the last question of my java module test. Pls explain me the answers. I do not know how to insert screenshot so I am writing the question.The question is Fill in the blanks to create a method called CHECK that takes the two parameters name and age. Output the name of the age is greater than17

8th Apr 2025, 4:25 AM
Nilakshi
4 Answers
+ 4
Nilakshi panda it would be something like this... public class Main { public static void CHECK(String name, int age) { if (age > 17) { System.out.println(name); } } public static void main(String[] args) { // Example usage CHECK("Alice", 20); // This will print: Alice CHECK("Bob", 16); // This will print nothing } }
8th Apr 2025, 4:59 AM
BroFar
BroFar - avatar
+ 4
You're welcome 😊 🙏
8th Apr 2025, 5:17 AM
BroFar
BroFar - avatar
+ 3
Ooh thanks a lot!!! I will check the answer now
8th Apr 2025, 5:01 AM
Nilakshi
+ 3
Thank you very much sir. I was able to get my certificate bc of you
8th Apr 2025, 5:09 AM
Nilakshi