Professional Documents
Culture Documents
Class 11 Ev2 Notes
Class 11 Ev2 Notes
Question 1
1. int a[-40]
2. int a[40] ✓
3. float a[0 - 40]
4. None
Question 2
1. 10th
2. 9th
3. 11th ✓
4. None
Question 3
1. packets
2. blocks
3. subscripts ✓
4. compartments
Question 4
1. subscripted variable ✓
2. actual variable
3. compound variable
4. none
Question 5
Question 6
1. Insufficient cells
2. Array index out of bounce
3. Elements exceeding cells
4. None ✓
Question 7
1. assigns 37 to code[1] ✓
2. assigns 25 to code[1]
3. assigns 38 to code[3]
4. assigns 42 to code[0]
Question 8
1. from 1 to 50
2. from 0 to 49 ✓
3. from 1 to 51
4. none
Question 9
1. m.size of (a)
2. m.elements of (m)
3. m.length ✓
4. None
Question 10
1. N-1 ✓
2. N
3. N+1
4. None
Question 1
Output
46
Explanation
Question 2
Output
Sum = 27
Explanation
a[0]=23 assigns 23 to the first element of the array. a[3]=a[1] assigns the value
of second element of the array which is 4 to the fourth element of the array.
After the execution of these two statements array looks like this:
{23, 4, 6, 4, 10}
a[0]+a[1] ⇒ 23 + 4 ⇒ 27
Question 3
Output
12
Explanation
a[2+1] ⇒ a[3] ⇒ 12
Question 4
int a[4]={2,4,6,8};
for(i=0;i<=1;i++)
{
s=a[i]+a[3-i];
System.out.println(s);
}
Output
10
10
toUpperCase()
Syntax:
trim()
Question 3
toLowerCase()
Syntax:
Question 4
length()
It returns the length of the string i.e. the number of characters present in
the string.
Syntax:
Question 5
replace()
Syntax:
Question 6
compareTo()
It compares two strings lexicographically.
Syntax:
Question 7
reverse()
Syntax:
<StringBuffer-Variable>.reverse();
Question 8
indexOf()
It returns the index within the string of the first occurrence of the
specified character or -1 if the character is not present.