Storage Classes in C

Storage Classes in C

Storage Classes in C Storage classes in the C Programming Language are classified into four main types according to the storage area and their behavior. In this C programming tutorial, we use these storage classes in many programs:- Automatic storage class: Automatic storage class variables in the C Programming Language will be created and destroyed … Read more

Classes and Objects in Java

Classes and Objects in Java

Classes and Objects in Java Java class is a set of related objects. The object(addition a1=new addition();a1 is the object) has some attributes, whose value consists of much of the state of an object. Class is a user-defined data type in Java. The complete set of data and code of an object can be made … Read more

Java Program to Calculate the Area of Rectangle

Java Program to Calculate the Area of Rectangle

Java program to calculate the  area of a rectangle using Scanner classes: import java.util.Scanner; public class Rarea { public static void main(String[] args) { Scanner inn = new Scanner(System.in); double height, width, area; System.out.println(“Area of Rectangle”); System.out.print(“Please enter the height: “); height = inn.nextDouble(); System.out.print(“Please enter the width: “); width = inn.nextDouble(); area = height … Read more

AWT Event Classes

AWT Event Classes

The Event classes represent the events that are generated when an end user interacts with the AWT components. The EventObject class is the superclass for handling all events. The class exists in the package java. util. The AWTEvent class is a subclass of the EventObject class, and all AWT events originate from the AWTEvent class. … Read more

Changing Font and Color in Java Applet

Changing Font and Color in Java Applet

Changing Font and Color in Java Applet To display text(write the text), you must first select a font. A font is specified by its name, such as “Arial”,  the style(plain, bold, italic, or bold italics), and the point size. A font is an object in Java, so we need to create it via a call … Read more

Daemon Thread in Java

Daemon Thread in Java

Daemon Thread in Java There are two types of threads The threads created by the user(create a thread in the program ) are called user threads. The threads that work in the background providing service to others are called Daemon Threads. The two methods used only  in the daemon thread, not in the user thread … Read more

String Constants vs Char Arrays in C

String Constants vs Char Arrays in C

A string constant is a series of characters(an array of characters or a group of characters) enclosed with double quotes(like “GOOD “). A string constant is a one-dimensional (str11[]) array of characters. A character constant is a character enclosed in single quotes. (like ‘G ‘). Each character in a string takes only 1 byte. String … Read more