How to draw Rectangle in Java Applet

Rectangle can be drawn by using drawLine() method. With this method, only the outline of the rectangle is drawn using Graphics object(Graphics gra)color but of the rectangle is not filled with this color. To draw a filled rectangle, the graphics class provide the fillRect() method.

The Finally block in Java

Finally blocks are executed once the try block exits. This block executes even after the unexpected exceptions has occurred. Irrespective of the try block, the expression in finally block is always executed. This block is in-built with the capability of recovering loss and preventing leak of resources. On closing and recovery of a file, the expression should be placed in the finally block.

Multi-Level Inheritance in Java

Multi-level inheritance was introduced to enhance the concept of inheritance. When a subclass is derived from another subclass or derived class, it is known as the multi-level inheritance. In multilevel inheritance, the subclass is the child class for its super class is the subclass for another super class. Multi-level inheritance can go up to any number of levels.

Passing a two-dimensional array as an argument in C

Array can also be passed to the function. To pass an array, you need to specify the name of the array and the size of the array in actual arguments. The corresponding formal arguments will also have array with two subscripts, size of first subscript can be omitted, a variable to hold the row size and a variable to hold the column size. The three arguments in the actual arguments list.

Program to find sum of positive numbers and exit when negative number is entered in C

In this example we use arrays(one dimensional array). Arrays are declared in the same as simple variables, but the difference is that each array name must be accompanied by a size(aa[20]) specification using subscript.

How to write a Tree Selection Listener in Java

A tree component is paired with some other component. When we selects tree nodes, some information shows up in another window.

Use of Sound and delay function in C

sound()is used to make a sound in a program. textattr() method is used for colourful characters.We can display Colourful Characters in TextMode and play sounds of random frequencies.

Storage Classes in C

Storage class is a characteristics of possession by a variable in C. The storage class of a variable determines the nature of the variable. Whenever you declare a variable, specify the storage class and data type of variable. C language supports four types of storage class 1)auto 2)register 3)static 4)extern

Switch Statement in C

The switch statement is a multiway decision making statement which selects one of the several alternatives based on the value of integer variable or expression. Switch statement requires only one arguments, which is then checked of case options.Break statement is essential use with switch statement because it stops the execution of succeeding cases and transfers the control out.

Changing the Label of a JButton Component in Java

JButton is a Swing Component which defined in package javax.swing.*;This program helps to change the Label(Caption) of the Button.The label of the Button “New” is changed into “Save” .

Page 10 of 29

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @