Converting an int to a binary in Java


By using Integer.toBinaryString() we can convert integer string into binary value.This is the best way to convert integer to a binary string in Java.


Java StringBuffer Reverse Example


The sequence of character contained in the string buffer is replaced by the reverse method(reverse()).String Buffer class is a mutable class means can be changed dynamically.

StreamTokenizer in Java

Stream Tokenizer takes an input stream(any String with seperator) and parses it into tokens, allowing the tokens to be read once at a time. 


Java Graphics in Applet

Graphics operations can be performed using java.awt package that contains various classes and methods for creating graphics and images.The paint() takes graphic object as an argument and provides reference to graphics drawing methods(setColor(),drawstring()).

If Else Statement in C++

The general form of an if statement which includes the else(if…..else) clause is:

Pointers and Strings in C++

An array of pointers makes more efficient use of available memory by consuming lesser number of bytes to store the strings. An array of pointers make more the manipulation of the strings much easier.

Reverse a String using Pointer in C

String reverse means reverses the order of all the characters in a string. String are stored in Array of type char, with the end of the string marked by the null character.

Difference between Parameters and Arguments

A PARAMETER is an entry in a function header. A function’s parameters are fixed; they do not change during program execution.

Function Overloading in C++

C++ supports overloading of function names and operators for both user defined types and built in types.For Example we can create several functions named print, or we could overload the “+” operator to work for a new type. In C++ , a function name is overloaded by simple declaring (and defining)several functions with that name.

Implementing the Runnable Interface

The Runnable interface consists of a single method run() which required for implementing thread. We will create a thread and pass the object of the class that implements the Runnable interface as an argument of the Thread class’s constructor. The thread will now be activated by calling the start().

Page 6 of 30