Java Program to Add Two Numbers

This Java program adds two integers given in the program and displays the result on the screen. To understand the topic, you need to have a basic understanding of two basic topics in Java. Java Operator Java Input/Output Java Program for the Sum of two numbers Output: Sum of num1 and num2: 50 Java Program … Read more

Java – File Class with Example

Java file Class deals directly with the file and file system. That is, it is the abstract representation of file or directory pathname. It defines the properties of the file itself rather than describing how information is stored in or retrieved from files. File class contains various methods for working with the pathname, deleting and … Read more

Java – Files I/O

Java Input/Output is used for processing input and giving out output. The package java.io contains all the required classes needed for input/output operation. Java uses the term stream for the representation of I/O operation. Stream A stream is a sequence of data. A stream supports many data such as primitives, objects, localized characters, objects, etc. Java’s stream-based … Read more

Java – Applet, Life Cycle of Applet and Methods

The applet in Java is a special type of internet-based program, that runs on the web browser and works at the client-side. It is used to make the webpage more dynamic and provide interactive features that cannot be applied by the HTML alone. Any applet in Java is a class that extends the java.applet.Applet class. … Read more

Java – Exception Handling

An exception in Java is an event that arises during the execution of a program i.e. during run–time. The occurrence of an exception in a program disrupts the normal flow of instructions. This causes the termination of the program or application and therefore needs to be handled by calling an exception handler, which deals with … Read more

Java – Event Handling

Event: An event is an object that describes the change of state in a source. It is the changes made within the GUI(Graphical User Interface). The activities that cause the event to be generated are the pressing of a button, selecting items, input the information, clicking of the mouse, etc, basically all the interaction with … Read more