Interface in Java

 

Java cannot support multiple Inheritance means we cannot create multiple super classes or we can say parents classes or base classes .This is the main reason we can create interface. In interface we can declare function only but not create the body.

 

How to draw a Smiley Face

Graphics is one of the most important feature of Java.Java applets can be written to draw lines.arcs,images and text in different fonts and styles. Different colors can also be display. The origin of each window at the top-left corner and is(0(x),0(y)). Coordinates are specified in pixels.

For loop

 The for loop, as in C, repeats statement or blocks of statements some number of times until a condition is matched or fulfill(complete). For loops are basically used for simple iteration in which you repeat a block of statements a certain number of times and then stop. But you can use “for” just any kind of loop.

Macros in the C Programming

 # define is used to make definition in a C program.Here we define a
constant MAX with its value 12, whenever program encounters Max, it
is replaced to 12. Do not speak for itself, what it is, but from MAX.

Free Flowing Switch Statement

            

Free Flowing Switch statements are executed if we don’t use break statement, if we use break then it will gives output only one case. But we don’t write break then this will gives output Of all the cases with default case.Break is used to terminate the statement.

Interface

/*An interface is basically a kind of class. The difference is that interface define any abstract methods and final fields(datamember or data functions). Interfaces do not specify any code,we can declare methods and  data fields contain only constant. Therefore, it is the responsibility of the class that implements an interface to define the code for implementation of these meathods.

Fixed width fields in c++

setw() is the I/O Manipulator  which is used to sets the width of the fields.

#include<iomanip.h> header file is used for manipulators.

It takes the size of the field(in number of character)as parameter.

Final Variable

 The value given to the final variable  will not be changed and the value given to final variable must be given at the time of declaration.

Destructor

If a class can have a constructor to set things up, it should also have a destructor to destruct the object.A destructor is also a member function like constructor whose name is the same as the class name and can be defined like any other member function.Tilde('~') symbol is used for destruct the object. A destructor takes no arguments, no return types. A destuctor cleanup the storage(memory area of the object). The symbol('~')refers to a NOT means destructor is a Not Constructor.A constructor initializes an object and a destructor deinitializes an object.

Double converted to String

Convert Double object to String object means we can convert double value into string.Here “str” is the variable of string type and dObj is of double type ,we input the value in double but retrieve by using str variable.

Page 26 of 29

About Us

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