Java Program Structure

Java Program Structure

Java Program Structure In Java Program Structure, the Java system may contain numerous classes, of which one and only one class characterizes the main technique. Classes contain information members and techniques that work on the information members from the class. Strategies may contain information, sort of revelation, and executable statements. To compose a Java program, … Read more

Java Abstract Window ToolKit(AWT)

Java Abstract Window ToolKit(AWT)

  AWT package is used for components and awt. event package is used for the action performed. If we want to select only one option, we use checkboxes.CheckboxGroup is a set of checkboxes in which we can select only one option(checkbox). The checkboxes that are set in CheckboxGroup are called “radio buttons”. Java Abstract Window … Read more

An Applet Program to Add Two Numbers

An Applet Program to Add Two Numbers

An Applet Program to Add Two Numbers Applets are simple Java programs that run in web browsers. The creation of web pages is related to Java Applets. An applet is an Internet-based Java program that can be included in an HTML page. An applet is a Java class defined in JDK’s java. applet package. Addition … Read more

Animation in Java Applets

Animation in Java Applets

Animation is defined as a rapid(fast/quick) display of text or images. These images or text have to be created in a specific pattern. When they are displayed rapidly, it causes an appearance of movement. Example of animation in Java Applet import javax. swing.*; import java.awt.*; public class animation1 extends JApplet implements Runnable { JLabel labelanimationn; … Read more

History of Java

History of Java

History of Java Java is an object-oriented programming language developed by James Gosling(James A. Gosling, a famous software developer, born on May 19, 1955, in Canada) at Sun Microsystems (Since 1984, he has been associated with Sun Microsystems and developed the Java Programming language in 1991). The language was initially called OAK(named after the OAK … Read more

Java Variables

Java Variables

What is a variable in Java? A variable is the name of the memory location from which we store the value. This is clear in the above example. A name that holds value. We can use variables to represent data. Representing attributes by variables. An attribute of an object can be referred to by a … Read more

Break Statement in Java

Break Statement in Java

Break statement in Java A break statement is one of the branching statements(break, continue) provided by Java, which is also used to control the flow of the program. A break statement in Java is used to exit (stop, terminate)from a running loop program on a condition that is predefined, before the loop completion(condition). By using … Read more

Compound Assignment Operators in Java

Compound Assignment Operators in Java

  The compound assignment operator in Java(+=,-=,*=,/=,%=,&=,|=,^=,<<=,>>=,>>>=) is a combination of the assignment operator and another operator, such as an arithmetic operator. So they are also known as Shorthand assignment operators. Syntax:   Variable operator variable or constant The following Table shows the compound assignment operators and their usage Operator                    Expression(shorthand)                   meaning +=                             vall+=increasee;                            vall=vall+increasee; … Read more

Factorial Program in Java

Factorial Program in Java

Factorial number definition: Factorial of n number is the product(*) of all positive integer(1*2*3*4*5) Denoted : 5! Means 5*4*3*3*1=120 here 51 means 5 factorial 3! Means 3*2*1=6 here 3! Means 3 factorial   It is very interesting to note that the program with one type of loop can be converted to another program While a … Read more