The foreach Loops in Java

JDK 1.5 presented another for construct, which is known as foreach loop or extended for loop. This construct empowers you to cross the complete array successively without utilizing an extra variable. Sample Implementation: public class Mytestarray { public static void main(string[] args) { double[] myarray = {0.5, 1.2, 2.2, 3.4, 4.7}; for (double i: myarray) … Read more

The break Keyword in Java

The break keyword is utilized to stop the whole loop execution. The break word must be utilized inside any loop or a switch construct. The break keyword will stop the execution of the deepest circle and begin executing the following line of code after the ending curly bracket. The syntax for using this keyword is … Read more

The Bitwise Operators in Java

The bitwise operators available in Java can be easily applied to a number of data types. These data types include byte, short, long, int and char. Typically, any bitwise operator performs the concerned operation bit-wise. For instance, if you consider the example of an integer x, which has the value 60. Therefore, the binary equivalent … Read more

Modifier Types

Modifiers are catchphrases that you add to definitions to change their implications. The Java programming language has a wide and mixed bag of modifiers, including the accompanying: Non-Access Modifiers Java Access Modifiers In order to utilize a modifier, you incorporate its catchphrase in the meaning of a class, variable or method. The modifier goes before … Read more

Class/Static Variables

Class variables otherwise called static variables are declared with the static keyword in a class, yet outside a constructor, method or scope. There would just be one duplicate of each class variable for every class, paying little mind to what number of objects are made from it. Static variables are seldom utilized other than being … Read more