Advert

Java Method

Last edited by . Total of 2 comments in the discussion.

Java Method is very much similar to a normal method or a function written within a class definition. Java method is basically a set of statements group together to perform a specific task. This method is included in a class. An object instantiated from a class can call methods of that class. Every Java method has a basic structure which must be followed to create any type of method. This structure of a Java method holds the following components: Method Header [Modifiers + Return Value Type + Method Name + Read More

Share on:

Java Variables

Last edited by . Total of no comments in the discussion.

A Java variable is an element that stores a specific type of value. It is commonly declared as a member variable within a class. A variable declared inside a class becomes an Instance variable and his associated to every instance created from that class. That is, every time a new object of that class is created, a new instance of its variable will also be created. Alternately, a Java variable declared inside a method is not an Instance variable. That variable is local to that method only, thus the name Read More

Share on:

NoClassDefFound

Last edited by . Total of no comments in the discussion.

NoClassDefFound means “No Class Definition Found”. NoClassDefFound is an error from the JVM when it cannot find a class required to run a Java program. This error could be caused by an actual missing class, but it is usually caused by a faulty CLASSPATH. This error also sometimes occurs when Java users add the unnecessary .class extension to the end of their command lines: C:>java HelloWorld.class Exception in thread “main” java.lang.NoClassDefFoundError: HelloWorld/class C:>java HelloWorld Hello World!

Share on:

Java Applet

Last edited by . Total of no comments in the discussion.
Java Applet Inheritance

An Applet is generally a small application module that is developed to perform one specific task and it runs under the umbrella of another bigger application. In other words, an Applet often acts as a plug-in which can easily be integrated into a suitable application. Similarly, Java Applet is a small module written in the Java programming language which can be injected into any webpage to perform a specific task. The origin of the word “Applet” was first noticed in PC Magazine, 1990. Java Applet is run in a Java Read More

Share on:

How to Declare a Constant in Java

Last edited by . Total of 2 comments in the discussion.

Java does not directly support constants. However, a static final variable is effectively a constant. The static modifier causes the variable to be available without loading an instance of the class where it is defined. The final modifier causes the variable to be unchangeable. Naming Standards for Java Constants Java constants are normally declared in ALL CAPS. Underscores normally separate Words in Java constants. Sample Java Constant Declaration public class MAX_UNITS { public static final int MAX_UNITS = 25; Vedios Related to Java Constant Declaration

Share on:

Override

Last edited by . Total of no comments in the discussion.

Sometimes a subclass inherits a method from a superclass that doesn’t quite fit its needs. Perhaps the subclass inherited twenty methods and just one of them wasn’t quite right. In that case, the subclass would override that method by redefining that method itself. This override does not affect the method as defined in the superclass.

Share on:

Java Loops – For, While, and Do

Last edited by . Total of 1 comment in the discussion.

Java supports three types of loops: For, While, and Do. The Java For Loop The Java for loop is a looping construct which continually executes a block of statements over range of values. Java for Loop Syntax The syntax of a for loop in Java is: for (initialization; termination; increment) { statement } Example Java for Loop Here is a Java for loop which prints the numbers 1 through 10. for (int loopvar = 1; loopvar <= 10 ; loopvar++) { System.out.println(loopvar); } The Java While Loop A Java while Read More

Share on:

How Do I Enable Javascript on My Computer?

Last edited by . Total of no comments in the discussion.

To promote a better experience on different websites, owners of these websites use JavaScript. However, there are instances where JavaScript gets disabled and some of the different components on the site can't be experienced because of this. Enabling JavaScript is different for each web browser, but all of it takes about a minute to complete. Once you're done, simply restart the browser and JavaScript will be enabled. Enabling JavaScript on Internet Explorer To enable JavaScript on Internet Explorer, go to the top and click tools. Then click Internet Options. For Read More

Share on:

Java Virtual Machine

Last edited by . Total of no comments in the discussion.

A Java Virtual Machine is quite simply a piece of software that enables Java technology to be recognized and successfully executed on a vast array of hardware platforms. Java virtual machines are so named because they provide a necessary environment for the Java bytecode to be executed. The flexibility of a JVM allows a Java applet to be written only once, but able to be run on virtually any operating system. Java virtual machines accept standardized binary format code. Java compilers translate this code into the necessary format needed before Read More

Share on:

How to Check the Java Version

Last edited by . Total of no comments in the discussion.

It is quite important to know which version of Java is presently installed on your computer. This might specially come handy to those who are developing applications and software on the Java platform. Using an outdated version of Java may hinder your Java development or even render web pages inappropriately in your browser. Mentioned below are few straightforward ways to check which version of Java is installed on your computer. Command Line Open Command Prompt and type in the following command: java -version Upon successful execution, the command will output Read More

Share on: