Variable declaration in Java (Netbeans)

-1

Help please, I need to create a variable to make an accountant, but I need that the whole variable can be called in all the Jframes of my package, I have tried in some ways and I still do not get it

    
asked by Hans Rodriguez 25.09.2018 в 02:32
source

2 answers

0

You can declare the variable publicly so that it can be accessible from other classes that are within the same package, for example:

public int num;

    
answered by 25.09.2018 в 02:42
0

Hi, I recommend that you create a Getter and use this to obtain the value, now if you put more in context what you want to do, we can help you more. Greetings

    
answered by 25.09.2018 в 02:59