Which one should I do...

I'm making a thing that allows me to grab the version of my PaperMC plugin, but I was thinking if I should make a static method for it or should I store the version in a static variable, which one is better?
public static String getVersion() {
return instance.getDescription().getVersion();
}
public static String getVersion() {
return instance.getDescription().getVersion();
}
or
public static String version = instance.getDescription().getVersion();
public static String version = instance.getDescription().getVersion();
2 Replies
JavaBot
JavaBot6d ago
This post has been reserved for your question.
Hey @Azex! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot6d ago
Post Closed
This post has been closed by <@670966991368224778>.

Did you find this page helpful?