Posts

Showing posts with the label static keyword

Java Keywords (Part XVIII): The static keyword

This article summarize the use of the keyword static . I suggest you review Java Keywords (Part V): Classes vs Interfaces and Java Keywords (Part IX): Switch Statements before proceeding. Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const * float native super while Keyword marked with an asterisk (*) are keywords that, although valid, are not used by programmers. Very early in this series, I discussed the use of the keyword static and mentioned that I would leave for later discussion another use of that keyword. Well, the time has come. Using static method in interfaces Let me start by saying that the only re