- Class 10 Java Program
- ICSE Java Programs - Home
- Year 2025 Programs
- Short Questions/Answers
- Class & Object Based Program - CloudStorage
- Square root of sum of squares of all elements - NORM
- Super String Program
- Binary Search Program
- Menu Driven Program
- Check Sum Program
- Solved Specimen Question Paper Year 2025 Programs
- Short Questions/Answers
- Class & Object Based Program - Bank
- Binary Search Program
- String to Uppercase Program
- Sum of Row in Array Program
- SUPERSPY Program
- Menu Driven Program - Overload Method
- Year 2024 Programs
- Short Questions/Answers
- Class & Object Based Program - Courier Service Program
- Method Overloading Program
- EvenPal Program
- Diagonal Array Program
- Selection Sort Program
- Gmail ID Validation Program
- Solved Specimen Question Paper Year 2024 Programs
- Short Questions/Answers
- Class & Object Based Program - Eshop
- Selection Sort Program
- Count the Vowels Program
- Sum of Even & Odd Elements in Array Program
- Duck Number Program
- Method Overloading Program
- Year 2023 Programs
- Short Questions/Answers
- Class & Object Based Program - Student Stream Allocation
- Bubble Sort Program
- Menu Driven Program - Overload Method
- Print Number of Digits, Alphabets and Special Characters Program
- Linear Search Program
- Sum of Single and Double Digit Number in Array Program
- Year 2021 Programs
- Short Questions/Answers
- Class & Object Based Program - Hotel Bill Calculation
- Bubble Sort Program
- Menu Driven Program - Overload Method
- Method Overloading - Pattern & Series
- EvenPal Program
- Student Range Program
- Year 2020 Programs
- Short Questions/Answers
- Class & Object Based Program - Cab Service
- Binary Search Technique Program
- UpperCase Conversion Program
- Method Overloading
- Menu Driven Program - Pattern & Series
- Double Dimensional Array - Diagonal Sum
- Solved Specimen Question Paper Year 2020
- Short Questions/Answers
- Class & Object Based Program
- Arrange Student details using Selection Sort Method
- Class Overload Program
- Menu Driven Program
- Sum of elements in Double Dimensional Array Program
- Pair of Vowels Program
- Year 2019 Programs
- Short Questions/Answers
- Class & Object Based Program
- Menu Driven Program - Generate Unicode, Pattern
- Sort Array Elements in Ascending Order using the Bubble Sort Technique Program
- Series Overload Program
- Count Letters in a Sentence Program
- Tech Number Program
- Year 2018 Programs
- Short Questions/Answers
- Class & Object Based Program - Railway Ticket
- Pronic Number
- Proper Case Sentence Program
- Function Overloading - Volume Program
- Menu Driven Program - Pattern
- Deviation Program
- Year 2017 Programs
- Short Questions/Answers
- Class & Object Based Program - Electric Bill
- Spy Number Program
- Menu Driven Program - Series Program
- Array Based Program - Largest Number, Smallest Number, Sum of Numbers Program
- Function Overload - String Program
- Alphabet Sort - Selection Sort Techniques Program
- Solved Specimen Question Paper Year 2017 Programs
- Short Questions/Answers
- Class & Object Based - Taxi Meter Program
- Menu driven - Sum of Series Program
- Abbreviation Program
- Largest & Smallest Integer in Array Program
- Sum of Prime Numbers Program
- Sort Names in Array Program
- Year 2016 Programs
- Short Questions/Answers
- Class & Object - Book Fair Program
- Menu Driven - Pattern Program
- Palindrome or Special Word Program
- Function Overloading - Sum of Series Program
- Niven Number Program
- Two Different Arrays Program
- Year 2015 Programs
- Short Questions/Answers
- Class & Object - Parking Lot Program
- Pattern Program
- Array Based Student Result Program
- Function Overloading String Based Program
- Arrange Names - Bubble Sort Technique Program
- Menu Driven - Factors/Factorial Program
- Year 2014 Programs
- Short Questions/Answers
- Class & Object - Movie Magic Program
- Special Two-digit Number Program
- Assign Full Path and File name Program
- Function Overloading - Area Program
- Menu Driven - Bank Deposit Program
- Array Sort - Binary Search Program
- Year 2013 Programs
- Short Questions/Answers
- Class & Object - FruitJuice Program
- International Standard Book Number (ISBN) Program
- Piglatin Program
- Descending Order Bubble Sort Program
- Function Overloading - Sum of Series Program
- Menu Driven - Composite Number / Smallest digit in Number Program
- Year 2012 Programs
- Short Questions/Answers
- Class & Object - Library Program
- Income Tax Calculation Program
- Double Letter Sequences in a String Program
- Function Overloading - Polygon Program
- Menu Driven - Fibonacci / Sum of Digits Program
- STD (Subscriber Trunk Dialing) Codes Program
- Year 2011 Programs
- Short Questions/Answers
- Class & Object - Mobike Program
- Descending Order - Selection Sort Program
- Special Number Program
- New Word by replacing Vowels with the next Character Program
- Function Overloading - Compare Integers, Characters, Strings Program
- Menu Driven - Series Program
- Year 2010 Programs
- Short Questions/Answers
- Binary Search Program
- Class & Object - Student Marks Program
- Ticket Discount Program
- Menu Driven - Prime Number / Automorphic Number Program
- Combine Two Arrays in Third Array Program
- Frequency of Characters in a String Program
- Year 2009 Programs
- Short Questions/Answers
- Electronic Shop Discount Program
- Generate Triangle / Inverted Triangle Program
- Longest Word Program
- Function Overloading - Number Calculation Program
- Menu driven - BUZZ Number / GCD Program
- Exam Results Program
- Year 2008 Programs
- Short Questions/Answers
- Tax Computation Program
- Reverse Uppercase & Lowercase in String Program
- Sort String Bubble Sort Program
- Menu Driven - Palindrome / Perfect Number Program
- Function Overloading - Volume Program
- Sum of Series Program
- Year 2007 Programs
- Short Questions/Answers
- Salary Calculation Program
- Sum of Series Program
- Maximum & Minimum Program
- Count of a word in String Program
- Menu Driven - Temperature Program
- Palindrome Program
Java Programs - Solved 2014 ICSE Computer Science Paper
![]() Share with a Friend |
Solved 2014 ICSE Computer Science Paper
Class 10 - ICSE Computer Science Solved Papers
Short Questions/Answers - ICSE 2014 Computer Science
Question 1
(a) Which of the following are valid comments?
(i) /*comment */
(ii) /*comment
(iii) //comment
(iv) */comment*/
/*comment*/
(b) What is meant by a package? Name any two Java Application Programming Interface package.
Packages are means of defining modules in Java and are used to group logically related classes together. They help in avoiding name conflicts. Two examples are java.io and java.util.
(c) Name the primitive data type in Java that is:
(i) a 64-bit integer and is used when you need a range of values wider than those provided by int.
long
(ii) a single 16-bit Unicode character whose default value is ‘\u0000’.
char
(d) State one difference between floating point literals float and double.
The float literal occupies 32 bits whereas the double literal occupies 64 bits.
(e) Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array.
int a = new int(5);
for(int i = 0; i <= 5; i++) a[i] = i;
int a[] = new int[5];
for(int i = 0; i < 5; i++)
a[i] = i;
Question 2
(a) Operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence.
(i) &&
(ii) %
(iii) >=
(iv) ++
++, %, >=, &&
(b) Identify the statements listed below as assignment, increment, method invocation or object creation statements.
(i) System.out.println(“Java”); Method invocation
(ii) costPrice = 457.50; Assignment
(iii) Car hybrid = new Car(); Object creation
(iv) petrolPrice++; Increment
(c) Give two differences between switch statement and if-else statement.
(i) The switch statement tests for one variable, whereas the if-else statement tests for multiple variables.
(ii) The switch statement only tests for equality, whereas the if-else statement can test for any type of condition.
(d) What is an infinite loop? Write an infinite loop statement.
An infinite loop is one that keeps on executing repeatedly because its terminating condition is either missing or is never reached.
for(;;)
System.out.println("Java");
(e) What is a constructor? When is it invoked?
A constructor is a member function with the same name as its class. It is used to initialize the objects of the class with legal initial values.
It is invoked at the time of object creation.
Question 3
(a) List the variables from those given below that are composite data types.
(i) static int x;
(ii) arr[i] = 10; (Composite)
(iii) obj.display(); (Composite)
(iv) boolean b;
(v) private char chr;
(vi) String str; (Composite)
(b) State the output of the following program segment:
String str1 = "great"; String str2 = "minds";
System.out.println(str1.substring(0, 2).concat(str2.substring(1)));
System.out.println(("WH" + (str1.substring(2).toUpperCase())));
grinds
WHEAT
(c) What are the final values stored in variables x and y below?
double a = -6.35;
double b = 14.74;
double x = Math.abs(Math.ceil(a));
double y = Math.rint(Math.max(a, b));
x = 6.0
y = 15.0
(d) Rewrite the following program segment using the if-else statements instead of the ternary operator.
String grade = (marks >= 90)? "A" : (marks >= 80)? "B" : "C";
String grade = "";
if(marks >= 90)
grade = "A";
else if(marks >= 80)
grade = "B";
else
grade = "C";
(e) Give the output of the following method:
public static void main(String[] args){
int a = 5;
a++;
System.out.println(a);
a -= (a--) - (--a);
System.out.println(a);
}
6
4
(f) What is the data type returned by the library functions:
(i) compareTo()
int
(ii) equals()
boolean
(g) State the value of characteristic and mantissa when the following code is executed:
String s = "4.3756";
int n = s.indexOf('.');
int characteristic = Integer.parseInt(s.substring(0, n));
int mantissa = Integer.valueOf(s.substring(n + 1));
characteristic = 4
manissa = 3756
(h) Study the method and answer the given questions:
public void sampleMethod(){
for(int i = 0; i < 3; i++){
for(int j = 0; j < 2; j++){
int number = (int)(Math.random() * 10);
System.out.println(number);
}
}
}
(i) How many times does the loop execute?
6 times.
(ii) What is the range of possible values stored in the variable number?
The range is 0 to 9.
(i) Consider the following class:
public class myClass{
public static int x = 3, y = 4;
public int a = 2, b = 3;
}
(i) Name the variables for which each object of the class will have its own distinct copy.
a and b.
(ii) Name the variables that are common to all objects of the class.
x and y.
(j) What will be the output when the following code segments are executed?
String s = "1001";
int x = Integer.valueOf(s);
double y = Double.valueOf(s);
System.out.println("x = " + x);
System.out.println("y = " + y);
x = 1001
y = 1001.0
System.out.println("The King said\"Begin at the beginning!\" to me.");
The King said "Begin at the beginning!" to me.
