how can i call a method in an if else statement? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

how can i call a method in an if else statement?

8th Mar 2022, 2:06 AM
Japheth
3 ответов
+ 3
Japheth Provide full code to understand what you want. Here RegistryInterface is a class and doAddStudent is a static method which can be directly access through the class name.
8th Mar 2022, 3:39 AM
A͢J
A͢J - avatar
0
Yes
8th Mar 2022, 2:47 AM
Rupali Haldiya
Rupali Haldiya - avatar
0
Rupali i mean how i only found this option and dont understand this "registry interface" public static void main(String[] args) { //some code Scanner in = new Scanner (System.in); char choice = in.next().charAt(0); if(choice == 1) { RegistryInterface.doAddStdent(student); } //some code }
8th Mar 2022, 3:01 AM
Japheth