Posts

Showing posts from October, 2021

Basic Java Keywords have been covered!

I have covered what I considered the 42 most common keywords in the Java language. The remaining six keywords deal with more advanced topics like synchronization. With the already covered keywords, you should be able to write industry-caliber code. If you haven't read my articles yet, just search here for "Java Keywords." The keywords are covered in parts I through XVIII. I would like to use this opportunity to say thanks for sticking around. I hope this series have been of help to you. Regardless, I would love to hear from you soon. In the next few days, I will resume this series, hoping to complete all keywords by the end of this month (October 2021). See you soon!

Java Keywords (Part XVIII): The static keyword

This article summarize the use of the keyword default . 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 reas

Java Keywords (Part XVII): The default keyword

This article summarize the use of the keyword default . 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. Up until Java 8 (released in March, 2014), the default keyword had a single purpose, which was to indicate the default case in a switch statement. To illustrate quickly String color = "red"; switch(color) { case "red": case &qu