Life Cycle of an Applet IN JAVA

The creation of any applet requires the implementation of four methods of the Applet class. These methods have been discussed in the below. init: This method is planned for whatever introduction is required for your applet. It is called after the param labels inside the applet tag have been transformed. start: This method is naturally … Read more

Common Exceptions in Java

In Java, it is conceivable to characterize two categories of Exceptions and Errors. Programmatic exceptions: – These special cases are tossed unequivocally by the application or the API software engineers Examples: Illegalargumentexception, IllegalStateException. JVM Exceptions: – These are exemptions/mistakes that are solely or consistently thrown by the JVM. Some exceptions of this class are ArrayIndexOutOfBoundsException, … Read more

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 do…while Loop in Java

A do…while loop is similar to the while looping construct aside from that a do…while circle is ensured to execute no less than one time. The syntax for this looping construct is as follows: do { /Statements }while(<booleanexpression>); Perceive that the Boolean declaration shows up toward the end of the circle, so the code execute … 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

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