Java, Software Development

Array-backed Lists in Java

In Java, there are these array-backed lists that are generated when you convert arrays to lists using Arrays.asList(…). The list and the array objects point to the same data stored in the heap. Changes to the existing contents through either the list or array result to changing the same data.

Software Development

Java – Copy array by range

This post will show you how to copy a subset elements of an array by range. For example, copy elements from index 3 to 4 (exclusive). The range values work in the same way as the String’s substring method.

Software Development

Type Checking in JavaScript

Okay, JavaScript is a loosely-typed language, which means you do not declare the data type of a variable explicitly. In a basic variable assignment expression, e.g., var i = 4;, the value that assigns to the variable determines the data type of the variable. As you assign different types of data to the same variable, its data type changes as well. Given the nature of JavaScript, finding out what data type a variable represents before using it is very important.