Arrays of objects in C++

An array is a non-primitive data type whose members (variables)are of the same type and stored in continuous memory functions, just as one can create an array of any basic data type, one can also create arrays of objects.

Friend function in C++

Friend keyword is used for friend functions.

In C++ class has data member and member function. Data member declare private that cannot be accessed outside the class, means non-member function of class. But some time situation is arises, private data member need to access outside the class. That is done by friend function. A friend function is called non-member function, when we create friend function, we can access private member of class.

How to display message in browser status bar using applet in Java

 

showStatus() is used to display the message in the status line.This method display a string in the status line .The status line is located at the bottom of the screen(browser or the appletviewer).

Draw a line in C++

Graphics is one of the main feature of c++. By using Graphics we can draw any shape.#include<graphics.h> header files defines a number of graphics function like

Point…….simply a pair(x,y)representing a coordinate in the window

Circle…….defines by a point and a radius

Line………Two points one is starting point and other is the end point

Message…..Used to display in the graphics window.

Program to accept three strings and arrange them in order of their length

We can enter three strings from the keyboard and arrange them in the order of their lengths.

readLine() is used to enter the string from keyboard(run time) and length() is used to determine

the length of the String.It returns the number of characters in the String.

Program to find Date and Time in Java

Date function is used to find the current date and time of the system.We use util package to use date method.java.util package provides language utility classes like Vectors,date etc.

Comparing two String in Java

“ String means Group of characters(single word like’s’) ”.If you want to compare two strings then ==(double equals) operator(s1==s2) is used. For comparing two strings equals methods(equals()) of string class is used.

Binary Operator Overloading in C++

Operator Overloading means overloading an operator.We can write function as normal but Function name is keyword(reserved keyword) "operator" with symbol(operator+).We can used this to overload the addition operator.

Pure Virtual Function

When we use same function name in both base class(parents class, super clas) and derived class
(child class, sub class), the function in base class is declared as virtual using the keyword virtual.
A virtual function, equated to zero(function name()=0) is called a pure virtual function.

Program to show how a method returns values

The return is a keyword in Java.In the program return statement is used with the methods which return a value. This is the main point to be noted that a function can return only one value.

Page 25 of 30

About Us

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