TwoSum
This sample code show how to achieve two distinct zero-based indices of any two of the numbers, whose sum is equal to the target sum.
This sample code show how to achieve two distinct zero-based indices of any two of the numbers, whose sum is equal to the target sum.
This tutorial show when passed two arrays of names, it will return an array without duplication. Approach 1: Approach 2: int array remove duplicate
The following program ask for character input. 1 for all kind of character, the other only accepts digits. You’re required to use your basic java knowledge to try to resolved. Knowledge required Character build in functions Array, ArrayList Array to
Palindrome is a word that reads the same backward or forward. This simple program show how to do it.
A block of code that can pass around and to be executed later once or multiple times.
When define a method in a class, we’ll need to define a method access modifier, optional modifier, return type and name. The sequence of access modifier and optional modifier can be in order or not in order. Access modifier :
Java allow method to be overloaded, but there is a rules to be followed. Rules: Match by type exactly, same parameter types Larger primitive type, Eg called parameter int, method parameter long Autoboxed type Varargs array to …[type] Example: Match
This topic discuss about array with sorting and unsorting with binary search. With a origin sequent array number not in sequence, search result is unpredictable. With a origin sequent array number in sequence or sorted. Search result is predictable and
Primitive pass by value, object pass by reference? Not exactly true, preferable statement should be Java variable hold reference to an object, they’re not hold objects. Primitive Argument Test Run the program, the result show the primitive int has hashcode
Array key point: Not scalable, once constructed length cannot be change, When construct numeric primitive type, it will filled with default value. byte, short, int, long, double, float 0 char filled with empty. boolean filled with false. object filled with