ICSE Practice test 3 class X : Top Questions
Sample Input: 15390Sample output: Sum of digits=18 Define a class student having the following description
Watch Java videos
In this ICSE practice test all the topics of java for ICSE computer application has been covered.
Create a class with one integer instance variable. Initialize the variable using [2]
- Default constructor
- Parameterized constructor.
State two features of a constructor. [2]
What is a static function? [1]
Write a function to find the sum of the digits of an integer that is input. [10]
Sample Input: 15390
Sample output: Sum of digits=18
Define a class student having the following description
Data members
String name-> to store name
int roll-> to store roll no.
int p,c,b-> to store physics, chemistry ,bio marks
double avg-> to store average of science marks
Member function
Input()-> to accept details of student from user
Calculate()-> to calculate science marks
Display()-> to display name, rollno, science marks, average
String Handling
Related Posts
Continue learning with these related articles
Sum of First n Natural Numbers in Java (Loop and Formula)
Find the sum of the first n natural numbers in Java with a for loop, a while loop and the formula n(n + 1)/2, with a dry run and the sums of even numbers, odd numbers, squares and cubes.
Prime Number Program in Java: Check a Number and Print Primes in a Range
Check whether a number is prime in Java by counting its factors, a faster square-root method with isPrime(), and a program that prints all prime numbers in a range.

Encapsulation, Access Specifiers and Scope of Variables in Java for ICSE Class 10
ICSE Class 10 Computer Applications notes on encapsulation: private, default, protected and public access, data hiding with getter and setter methods, instance vs static (class) variables, local variables and scope, with a solved BankAccount program.