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
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
}
}
+ 4
You're welcome 😊 🙏
+ 3
Ooh thanks a lot!!! I will check the answer now
+ 3
Thank you very much sir. I was able to get my certificate bc of you