What are annotations in Java, and what purpose do they serve?
Annotations are a form of metadata that attach information to Java code elements (classes, methods, fields, parameters) without directly affecting…
28 key Java questions with one-line answers, covering 14 topics, on a printable sheet. Read it the night before, or pin it next to your screen.
Annotations are a form of metadata that attach information to Java code elements (classes, methods, fields, parameters) without directly affecting…
A custom annotation is defined using @interface; @Retention specifies how long the annotation is retained (SOURCE, CLASS, or RUNTIME -- with RUNTIME…
An array is declared with a type followed by square brackets (int[] arr), instantiated with new specifying its fixed size (new int[5]) or using an…
Java doesn't have true multidimensional arrays in the C sense; a 2D array (int[][]) is actually an array of arrays, where each row is an…
The full sheet has 28 questions. Sign in (free) to open it and save it as a PDF.