Java

319
3458 reads

February 26, 2013

Demonstrate exec()


exec(String[] cmdarray)
throws IOException
Executes the specified command and arguments in a separate process.

398
4181 reads

February 26, 2013

Demonstrate totalMemory(), freeMemory() and gc().


Although Java provides automatic garbage collection, sometimes you will want to know how large the object heap is and how much of it is left.

110
2232 reads

February 26, 2013

Demonstrate several Is... methods


isLetter(char ch)
Determines if the specified character is a letter.

isLetterOrDigit(char ch)
Determines if the specified character is a letter or digit.

203
3377 reads

February 26, 2013

Convert an integer into binary, hexadecimal and octal


toBinaryString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 2.

toHexString(int i)

230
4393 reads

February 25, 2013

Sum of numbers


Description:
This method is used to get the primitive data type of a certain String. parseXxx() is a static method and can have one argument or two.

Syntax:

252
4607 reads

February 25, 2013

isInfinite() and isNaN()


Float and Double provide the methods isInfinite( ) and isNaN( ), which help when manipulating two special double and float values.

77
2507 reads

February 25, 2013

Double demo


The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double.

150
2340 reads

February 25, 2013

PropertiesList-Database


This example demonstrates the to store data in database using Properties List.

46
2400 reads

February 25, 2013

Default-Properties List


This example demonstrates the Default instance of Properties class. In this way Properties defines the following instance variable:
Properties defaults;

176
2942 reads

February 25, 2013

Property-List


This example describes Properties class, a subclass of Hashtable. It is used to maintain lists of values in which the key is a String and the value is also a String.