In some cases I have used methods that are marked as obsolete, however everything works correctly, but I do not know if that could affect the execution of the code with the passage of time due to Java updates.
In some cases I have used methods that are marked as obsolete, however everything works correctly, but I do not know if that could affect the execution of the code with the passage of time due to Java updates.
No, you should not use them. If a method is marked as obsolete, it means that in some future version of Java that method may be removed, and your program will no longer work.
The fact that a method is marked as obsolete serves to give you time in advance to change your code once in preparation for the day when the method no longer exists.
The documentation for the annotation @Deprecated adds some additional reasons not to use them:
An element of a program annotated with
@Deprecated
is one that programmers should avoid using, typically because it is dangerous, or because there is a better alternative.
You should not use obsolete methods because, if a method is considered obsolete in new versions, it indicates that at some point it may stop working since it will not have more support or it may even be eliminated (and it will surely be what happens) in future versions.
You have to always try to use the methods that are in use, since an obsolete method is synonymous with the deprecated method. If you needed a specific program that could support some obsolete method, you could make a function so that it could work with both old and new Java versions, although in the future you should force the last version of Java to update.