title: What does "private static final" mean in Java?
body: <p>I am very new to android and I'm just scratching surface of it. When I was going through some Tutorials I came across this class to Download the File. I was able to understand Other code but I am unableto understand what does </p>
  
  <pre><code>  private static final int  MEGABYTE = 1024 * 1024;
  </code></pre>
  
  <p>Does? Is this really necessary? what if It is not declared First.</p>
  
  <p>Below is the Code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public class FileDownloader {
      private static final int  MEGABYTE = 1024 * 1024;
  
      public static void downloadFile(String fileUrl, File directory){
          try {
  
              URL url = new URL(fileUrl);
              HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
              //urlConnection.setRequestMethod("GET");
              //urlConnection.setDoOutput(true);
              urlConnection.connect();
  
              InputStream inputStream = urlConnection.getInputStream();
              FileOutputStream fileOutputStream = new FileOutputStream(directory);
              int totalSize = urlConnection.getContentLength();
  
              byte[] buffer = new byte[MEGABYTE];
              int bufferLength = 0;
              while((bufferLength = inputStream.read(buffer))&gt;0 ){
                  fileOutputStream.write(buffer, 0, bufferLength);
              }
              fileOutputStream.close();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>It must be very stupid Question but I was really curious to know How and why?</p>
  
  <p>Thanks in advance.</p>