TERTIARY AND VOCATIONAL EDUCATION COMMISSION
COMMON WRITTEN EXAMINATION
All rights reserved
NVQ Level 05 - Semester I
Information and Communication Technology
SOFTWARE PROGRAMMING K72C001M04 Three Hours
(THEORY)
* Answer any five (05) questions
Question ( 1 )
a) Briefly explain class and object with examples. (4 marks)
b) Write 3 access modifiers used in programming language. (3 marks)
c) What is the output of the following code segment? (3 marks)
(Follow Java or C#.Net code)
, Java Code:-
class Student
{
intIndexNo;
String name;
Student(intid,String name)
{
IndexNo = id;
name = name;
}
void display()
{
System.out.println(IndexNo +" "+name);
}
public static void main(String[]args)
{
Student objl=newStudent(100,"Juree");
Student obj2=new Student(102,"Newsy");
objl.display();
obj2.display();
}
}
Page2 | 8
COMMON WRITTEN EXAMINATION
All rights reserved
NVQ Level 05 - Semester I
Information and Communication Technology
SOFTWARE PROGRAMMING K72C001M04 Three Hours
(THEORY)
* Answer any five (05) questions
Question ( 1 )
a) Briefly explain class and object with examples. (4 marks)
b) Write 3 access modifiers used in programming language. (3 marks)
c) What is the output of the following code segment? (3 marks)
(Follow Java or C#.Net code)
, Java Code:-
class Student
{
intIndexNo;
String name;
Student(intid,String name)
{
IndexNo = id;
name = name;
}
void display()
{
System.out.println(IndexNo +" "+name);
}
public static void main(String[]args)
{
Student objl=newStudent(100,"Juree");
Student obj2=new Student(102,"Newsy");
objl.display();
obj2.display();
}
}
Page2 | 8