Monday, April 23, 2018

What is the default modifier of field / variable in an interface ?

  1. interface MyInterfaceExe {
  2. // Any number of final, static fields / variables
  3. int x = 10;
  4. // is equivalent to final static int x  = 10;
  5. String s = "ishaan";
  6. // is equivalent to final static String s = "ishaan";
  7. }
Note: The default nature of an interface field's / variable's  is public final static.

No comments:

Post a Comment

Blueprint for self-improvement

To learn faster: Make the process fun To understand yourself : Write To understand the world better : Read To build deeper connection : Lis...