Arrays and Strings — Class 11 ISC Computer Science revision notes
A 3-page visual revision sheet for Arrays and Strings, written for Class 11 ISC Computer Science. Formulas, diagrams and the traps that cost marks, laid out to be read the night before rather than the term before. Free, and it opens inside CapCompass.
Page 1 as PDFA preview of page 1 — all 3 pages open full size in the app.
Arrays and Strings in one look
a row of fixed slots, and the one object that never lets you edit its own characters
Declaring and filling a 1D array
int[] marks = new int[5]; creates an array of 5 int slots, each holding the default value 0 until it is set
an array literal, written as int[] marks = followed by 9, 3, 7, 1, 5 inside curly braces, declares and fills the array in one line, sizing it from how many values are listed
every slot is reached by an index, and Java indexes start at 0, so the first mark is marks[0], holding 9, and the last is marks[4], holding 5
a for loop from 0 up to but not including marks.length visits every slot exactly once, whatever the array's actual size turns out to be
Arrays have exactly one built-in property: length
marks.length gives the number of slots in the array, with no parentheses, since length is a property here and not a method
marks.length never changes once the array is created, an array in Java is a fixed size from the moment it is made
the highest legal index is always marks.length minus 1, and using marks.length itself as an index fails at run time
a 2D array such as int[][] grid = new int[3][4]; is really an array of arrays, 3 rows each holding 4 int slots, reached as grid[row][col]
array.length against String.length()
Array
length is a field, written without parentheses: marks.length
fixed at creation, an array can never grow or shrink
String
length() is a method, written with parentheses: word.length()
a String object never changes either, but a new String can be built from parts of it
Page 1 of 3. The full sheet, all 3 pages, opens free in the app.
These notes are not a standalone PDF. CapCompass plans Computer Science chapter by chapter against your real exam dates and free hours, and when the plan reaches Arrays and Strings the sheet opens inside the study block itself — at the page covering the sub-topic that block is on, with the timer still running. Revision arrives at the moment the plan says revise, instead of having to be gone looking for.