Page 1 of 1

About Question enthuware.ocpjp.v11.2.3395 :

Posted: Thu Jan 19, 2023 5:29 am
by yuir12
Hello, am not sure if I understand correctly application of @SuppressWarnings("deprecation")

if I change main method as per below, should I know apply @SuppressWarnings("deprecation") in main method to eliminate the warning?


public class TestClass {
public static void main(String[] args) {
Account c = new Account();
}
}

Re: About Question enthuware.ocpjp.v11.2.3395 :

Posted: Thu Jan 19, 2023 6:25 am
by admin
Yes, if you call any deprecated method inside main, then you will get a deprecated warning at compile time and to eliminate that warning, you may apply the @SuppressWarnings on the main method.