I have one public static variable in one file and how can I export the same variable to other files?
For ex:-
file1.java
public final static int buf = 256;
file2.java
How can I access the variable “buf” in this file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
File1.buf. More generally:ClassName.FIELD_NAME. A few notesCAPITAL_LETTERSto name your static final fields (BUF)static finalrather thanfinal static(not crucial, but it is a widely accepted style)