School Revise · Class 12 Information Technology · Chapter 3
Code 802, Class 12. Java builds real programs with methods, arrays and classes. Here we go further with functions, arrays and objects.
|
|
We build on Java basics with methods that we call, arrays that hold many values, and simple classes and objects.
A method is a named block of code. It can take values (parameters) and return a result, so we can reuse it.
|
static int add(int a, int b) { return a + b; } // call: add(5, 3) gives 8 |
An array holds many values of the same type, read by index. int[] marks = {80, 90, 70}; and marks[0] is the first value.
A class is a blueprint with data and methods. An object is made from a class with new, and we call its methods with a dot.
Explore the idea by tapping. The interactive opens right here in the lesson.
[sr_g12_it802 id=”g12-it802-ch3″]
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
method.
An array.
new.
number of elements.
|
Java builds real programs with methods, arrays and classes. A method is reusable code that can take parameters and return a result. An array holds many values of one type, read by index (a[0] is first, a.length is the count). A class is a blueprint; an object is made with new, and its methods are called with a dot. |
| Open the Virtual Lab |
These free Class 12 Information Technology (Code 802) notes explain Java programming, methods, arrays, and classes and objects, with worked programs with worked examples and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 12 Information Technology syllabus. Unauthorised copying is not permitted.