If you want to print values which are same for any line and only changes when it goes to the next line, then print outer loop variable.
If you want to print values which are changing within the same line, then print inner loop variable.

(a) Implicit Type Conversion: When the conversion takes place on its own without the programmer’s intervention.
(b) Explicit Type Conversion: When the conversion takes place with the programmer’s intervention.

Class is a user-defined / composite data type:
A class consists of data fields of one or more types representing the attributes of an object. Hence, it is a construct that binds one or more primitive types together to be used as a single data types. A class may be thought of as a ‘data type’ and an object as a ‘variable’ of that data type. It is designed by the programmer and thus, it is called user defined data types.

compareTo() function compares two String objects alphabetically.
It subtracts the ASCII value of the first different character present in the two String objects.
Example: “ACT”.compareTo(“CAT”) will give -2 as ASCII value of ‘A’ – ASCII value of ‘C’ = 65 – 68 = -2
Similarly: “CAT”.compareTo(“ACT”) will give 2.
So, we can say that if A.compareTo(B) gives a value > 0, then the String A and B are not arranged in alphabetical order and needs to be swapped.

an object can be defined as an instance of a class. For greater efficiency the class is broken down into a number of objects, which become a class’s integral parts. A class creates objects which have similar attributes. The objects are created from the information only available in that class, hence it is liable to be called as an instance of a class.

int r=(int)t%10;
s=s+(d*r);
d–;
t=t/10;
explain the working of this statement. if we have to find the sum of the digits or anything such that this kind of logic is often found in the program. how do they work?

Yes, you can use the “toCharArray()” function of the String class which converts a String into a character array.
So, if the string is, String s=”JAVA FOR SCHOOL”, then the statement,
char ch [] = s.toCharArray(); will make a character array like
ch[]={‘J’, ‘A’, ‘V’, ‘A’, ‘ ‘, ‘F’, ‘O’, ‘R’, ‘ ‘, ‘S’, ‘C’, ‘H’, ‘O’, ‘O’, ‘L’};

You have to think a String to be just like an array of characters. Like you use every element in the array by writing its index, similarly, in order to access the characters of a String, you need to extract the characters through their index using charAt() function.

Think of it this way, and if your concept of array is strong, then the working of Strings will be really easy for you.

An array is a container object that holds a fixed number of values of a single data-type. The length of an array is established when the array is created. After creation, its length is fixed.

So, if you have to store names of 50 students, then you would require 50 different variables. It is quite inconvenient to remember the names of so many variables. Instead of doing this, we can create an array having 50 elements for storing 50 names. You only have to remain the name of only a single array.
An array of 10 elements.

Illustration of an array as 10 boxes numbered 0 through 9; an index of 0 indicates the first element in the array.

Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.
So if the name of the array is arr[], then to access the 9th element, we have to write arr[8].

Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.

A program code is divided into various entities which are known as objects of a class.objects have the data and functions which are also known as characterstics and behaviour .object is a set of related data which can share the information and can interact with each other.

ICSE | ISC Sample Papers

In this section we will be providing you with the Sample/Guess papers of ICSE (Computer Applications) and ISC (Computer Science) which can be easily downloaded. We hope that the students will benefit from these resources.