Posts

Java Keywords (Part XX): The strictfp Keyword

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. This is going to be an easy one. As of Java 17, this keyword is obsolete. Prior to Java 17, this keyword was used to establish a strict floating-point (strict fp) policy. This meant that, when in use, this keyword guaranteed that floating point calculations would yield the same result across all hardware. When not in use, the Operating System had some leeway in refining precision of floating-point calculations. The keyword would be applied at

Java Keywords (Part XIX): The assert Keyword

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. The assert keyword enables you to test an assumption about a part of your program. If the assertion is proven to be true, execution of your program will continue. If it's proven to be false, an AssertionError will be thrown. Assertions confirm your assumptions about the behavior of your program, thus increasing confidence that the program is free of errors. This keyword has been part of the Java language since Java 1.4.2 and yet, very l

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

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

Java Keywords (Part XVI): The many uses of the super keyword

We are up to 40 keywords covered in previous articles! That's 83% keywords covered. We have only 8 keywords to cover and I will be covering 1 of those in this article. We are almost done with all the basic keywords. This article will illustrate the use of the keyword super . I suggest you start with Java Keywords (Part I) before proceeding further, if you have not read any of the previous articles in the Java Keyword series. Also, go back and read the one about Data Types. All of these articles are from September 2018. That should help you find them quickly. You can also use the "search" option at the top of this page. The series was written with natural progression in mind. Therefore, some of the keywords already covered may be used in code examples illustrated here. Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected throw

Java Keywords (Part XV): The many uses of the this keyword

We are up to 39 keywords covered in previous articles! That's 81% keywords covered. We have only 9 keywords to cover and I will be covering 1 of those in this article. We are almost done with all the basic keywords. This article will illustrate the use of the keyword this . I suggest you start with Java Keywords (Part I) before proceeding further, if you have not read any of the previous articles in the Java Keyword series. Also, go back and read the one about Data Types. All of these articles are from September 2018. That should help you find them quickly. You can also use the "search" option at the top of this page. The series was written with natural progression in mind. Therefore, some of the keywords already covered may be used in code examples illustrated here. Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected throw

Java Keywords (Part XIV): Using the instanceof Operator

We are up to 38 keywords covered in previous articles! That's 79% keywords covered. We have only 10 keywords to cover and I will be covering 1 of those in this article. We are almost done with all the basic keywords. This article will illustrate the use of the keyword instanceof . I suggest you start with Java Keywords (Part I) before proceeding further, if you have not read any of the previous articles in the Java Keyword series. Also, go back and read the one about Data Types. All of these articles are from September 2018. That should help you find them quickly. You can also use the "search" option at the top of this page. The series was written with natural progression in mind. Therefore, some of the keywords already covered may be used in code examples illustrated here. Java keyword list abstract continue for new switch assert default goto * package synchronized boolean do if private this break double implements protected