Chapter 2 - Library Classes - Solutions For APC Understanding Computer Applications With BlueJ ICSE Class 10 Java Programs - KnowledgeBoat
Chapter 2 - Library Classes - Solutions For APC Understanding Computer Applications With BlueJ ICSE Class 10 Java Programs - KnowledgeBoat
Home / Class 10 - APC Understanding Computer Applications with BlueJ / Library Classes
CONTENTS
Search by lesson title Chapter 2
Library Classes
Multiple Choice Questions
Chapter 1 - Unit 1 Fill in the blanks
Introduction to Object Oriented
Programming Concepts Class 10 - APC Understanding Computer Applications with State True or False
Chapter 1 - Unit 5a
Introduction to Java
Chapter 1 - Unit 5b
Input in Java
Chapter 1 - Unit 6
Mathematical Library Methods
Chapter 1 - Unit 7
Conditional Statements in Java
Chapter 1 - Unit 8
Iterative Constructs in Java
Chapter 1 - Unit 9
Nested Loop
Chapter 3
Arrays
Question 1
Chapter 4
String Handling
Chapter 5
A package contains:
User Defined Methods
Chapter 6
Class as the Basis of All Computation
1. tags
Chapter 7
Constructors
2. classes
3. data
Chapter 8
Encapsulation and Inheritance
4. arrays
Answer
classes
1. block
2. object
3. wrapper class
4. none
Answer
wrapper class
Question 3
1. autoboxing
2. explicit conversion
3. shifting
4. none
Answer
autoboxing
Question 4
The parseInt() function is a member of
Answer
Question 5
Answer
Question 6
1. Character.isBlankSpace( )
2. Character.isWhiteSpace( )
3. Character.isEmptySpace( )
4. Character.isNull( )
Answer
Character.isWhiteSpace( )
Reason — Character.isWhiteSpace( )
returns a boolean type value true if the
given argument is a white space and
otherwise, it returns false.
Question 7
1. Character.isLowerCase( ) and
Character.toLowerCase( ) are same.
2. Character.isLetter( ) and
Character.isAlphabet( ) are same.
3. parse and valueOf functions are same.
4. Character.isDigit( ) and
Character.isNumber( ) are same.
Answer
Question 8
The variable must be declared ........ type, if
a character is to be assigned to it.
1. char
2. ch
3. character
4. alphanumeric
Answer
char
Question 1
Question 2
Question 3
Question 4
Question 6
Question 7
Question 8
Question 1
Question 2
Question 3
Question 5
Question 1
char ch = '*';
boolean b = Character.isLetter(ch);
System.out.println(b);
Answer
Output
false
Explanation
false.
Question 2
char c = 'A';
int n = (int) c + 32;
System.out.println((char)n);
Answer
Output
Explanation
int n = (int) c + 32 ⇒ 65 + 32 ⇒ 97
So, variable n get the value of 97. 97 is the
ASCII code of small 'a' so casting n to
char, prints 'a' to the console.
Question 3
String s= "7";
int t =Integer.parseInt(s);
t = t + 1000;
System.out.println(t);
Answer
Output
1007
Explanation
char c = 'B';
int i = 4;
System.out.println(c + i);
System.out.println((int)c + i);
Answer
Output
70
70
Explanation
Question 5
char ch = 'y';
char chr = Character.toUpperCase(ch);
int p = (int) chr;
System.out.println(chr + "\t" + p);
Answer
Output
Y 89
Explanation
Question 6
int n = 97;
char ch = Character.toUpperCase((char)n
System.out.println(ch + " Great Victory
Answer
Output
A Great Victory
Explanation
Question 7
Answer
Output
Explanation
Question 8
char ch = 'A';
char chr = Character.toLowerCase(ch);
int n = (int)chr-32;
System.out.println((char)n + "\t" + chr
Answer
Output
A a
Explanation
Question 1
Answer
(a) Wrapper class
(c) Autoboxing
Question 1
Float.parseFloat()
Answer
Question 2
Double.toString()
Answer
Question 3
Integer.valueOf()
Answer
Question 4
Character.isDigit()
Answer
Question 5
Character.isWhitespace()
Answer
Question 1
What is a package?
Answer
Question 2
Question 3
Answer
Question 4(a)
Answer
isUpperCase() toUpperCase()
Question 4(b)
Answer
parseInt() toString()
Question 4(c)
Answer
by using primitive
data types.
Examples of
Examples of
primitive data types
composite data
are byte, short, int,
types are Class
long, float, double,
and Array.
char, boolean.
Question 5(a)
Answer
Question 5(b)
Answer
Answer
Question 1
import java.util.Scanner;
Output
Question 2
import java.util.Scanner;
System.out.println("Next 5 char
+ ch + " are:");
Output
Question 3
Question 4
import java.util.Scanner;
Output
Question 5
Output
Question 6
Write a program to input two characters
from the keyboard. Find the difference (d)
between their ASCII codes. Display the
following messages:
If d=0 : both the characters are same.
If d<0 : first character is smaller.
If d>0 : second character is smaller.
Sample Input :
D
P
Sample Output :
d= (68-80) = -12
First character is smaller
import java.util.Scanner;
Output
Question 7
String s = Long.toString(sum)
long r = Long.parseLong(s);
System.out.println("Concatenate
}
}
Output
Question 8
Write a menu driven program to generate
the upper case letters from Z to A and lower
case letters from 'a' to 'z' as per the user's
choice.
Enter '1' to display upper case letters from Z
to A and Enter '2' to display lower case
letters from a to z.
import java.util.Scanner;
System.out.print("Enter your ch
int ch = in.nextInt();
int count = 0;
switch (ch) {
case 1:
for (int i = 90; i > 64; i
char c = (char)i;
System.out.print(c);
System.out.print(" ");
count++;
//Print 10 characters p
if (count == 10) {
System.out.println
count = 0;
}
}
break;
case 2:
for (int i = 97; i < 123; i
char c = (char)i;
System.out.print(c);
System.out.print(" ");
count++;
//Print 10 characters p
if (count == 10) {
System.out.println
count = 0;
}
}
break;
default:
System.out.println("Incorre
}
}
}
Output
Question 9
import java.util.Scanner;
int a = (int)l;
System.out.println("ASCII Code
int r = 0;
while (a > 0) {
int digit = a % 10;
r = r * 10 + digit;
a /= 10;
}
System.out.println("Reversed Cod
System.out.println("Equivalent c
}
}
Output
Question 10
import java.util.Scanner;
System.out.print("Enter your ch
int ch = in.nextInt();
switch (ch) {
case 1:
for (int i = 65; i <= 69; i
System.out.println((cha
break;
case 2:
for (int i = 118; i <= 122
System.out.println((cha
break;
default:
break;
}
}
}
Output
Question 11
import java.util.Scanner;
System.out.println("Enter 1 for
System.out.println("Enter 2 for
System.out.print("Enter your ch
int ch = in.nextInt();
switch (ch) {
case 1:
System.out.println("Let
for(int i = 65; i <= 90
System.out.println
break;
case 2:
System.out.println("Let
for (int i = 122; i >=
System.out.println
break;
default:
System.out.println("Inc
}
}
}
Output
Question 12
(i)
A
ab
ABC
abcd
ABCDE
Output
(ii)
ZYXWU
ZYXW
ZYX
ZY
Z
Output
(iii)
ABCDE
ABC
A
public class KboatPattern
{
public static void main(String arg
for (int i = 69; i >= 65; i =
for (int j = 65; j <= i; j
System.out.print((char
}
System.out.println();
}
}
}
Output
(iv)
PRTV
PRT
PR
P
Output
(v)
A*B*C*D*E*
A*B*C*D*
A*B*C*
A*B*
A*
Output
(vi)
aaaaa
bbbbb
AAAAA
BBBBB
Output
Prev Next
Case Study based questions fro… Arrays
Class - 6 Effective History & Civics Solutions Java Number Programs (ICSE Classes 9 / 10) Privacy Policy
Class - 6 APC Understanding Computers Solutions Java Number Programs (ISC Classes 11 / 12) Terms of Service
Class - 7 Concise Physics Selina Solutions Output Questions for Class 10 ICSE Computer Applications
Class - 7 Concise Chemistry Selina Solutions Algorithms & Flowcharts for ICSE Computers
Class - 7 Dalal Simplified Middle School Chemistry Solutions ICSE Class 8 Computers Differentiate Between the Following
Class - 7 Living Science Biology Ratna Sagar Solutions Class - 8 NCERT Science Solutions
Class - 7 Around the World Geography Solutions Class - 9 NCERT Science Solutions
Class - 7 Veena Bhargava Geography Solutions Class - 9 NCERT Geography Contemporary India 1 Solutions
Class - 7 Effective History & Civics Solutions Class - 9 Sumita Arora Computer Code 165 Solutions
Class - 7 APC Understanding Computers Solutions Class - 9 Kips Cyber Beans Computer Code 165 Solutions
Class - 8 Concise Biology Selina Solutions Class - 10 NCERT History India & Contemporary World 2 Solutions
Class - 8 Living Science Biology Ratna Sagar Solutions Class - 10 Sumita Arora Computer Code 165 Solutions
Class - 8 Around the World Geography Solutions Class - 10 Kips Cyber Beans Computer Code 165 Solutions
Class - 8 Veena Bhargava Geography Solutions Class - 11 CBSE Sumita Arora Python Solutions
Class - 8 Effective History & Civics Solutions Class - 12 CBSE Sumita Arora Python Solutions
Class - 8 APC Understanding Computers Solutions Class - 12 NCERT Computer Science Solutions