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