+ 1

How can i access the value of variable inside interface in java from the main function?

Pls help me understand this with some programming example.

20th Aug 2019, 11:37 AM
Piyush Srivastava
Piyush Srivastava - avatar
2 ответов
+ 4
By using dot notation... interface Test{ int x=1; } in main: System.out.println(Test.x);
20th Aug 2019, 12:56 PM
voja
voja - avatar
20th Aug 2019, 1:31 PM
Danijel Ivanović
Danijel Ivanović - avatar