Monthly Archives: August 2013

Compare Strings in Java

The String class provides a method equals() to compare string values. The double equal sign == only compares the references, not the values. Here “a” and “b” are pointing to two different String objects. The equals() method will check the

Tagged with: , , ,
Posted in Java

Convert between String and Char Array in Java

Convert a String to an Array of Characters The String.toCharArray() method converts a string to a new character array. The following code gets an array of Character objects, instead of a character array. Convert an Array of Characters to a

Tagged with: , ,
Posted in Java

Google Maps with Multiple Markers and InfoWindow

Google Maps API provides Marker and InfoWindow to build interactive maps. This demo shows how to build a map with multiple markers with one infowindow. In the HTML page, add a div holding the map. In JavaScript, we first have

Tagged with: , ,
Posted in Web

Computation, Programming and Computational Thinking

What is Computation There are two types of knowledge: declarative and imperative. Declarative knowledge (or descriptive knowledge) is mainly expressed as statements of facts. For example, the following statement defines the term “maximum”: The maximum of a collection of numbers

Tagged with: , ,
Posted in Java