BIT2204A BBIT310 JAVA PROGRAMMING.

UNIVERSITY EXAMINATIONS 2017/2018
EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN
INFORMATION TECHNOLOGY/ BACHELOR OF BUSINESS IN
INFORMATION TECHNOLOGY
BIT 2204A/BBIT 310: JAVA PROGRAMMING
FULL TIME/PART TIME/DISTANCE LEARNING
DATE: DECEMBER, 2017 TIME: 2 HOURS
INSTRUCTIONS: Answer Question One & ANY OTHER TWO questions.

QUESTION ONE
a) What is a variable? 2 Marks
b) Differentiate between reference variable and primitive variable 2 Marks
c) Describe the steps involved in writing a java program 6 Marks
d) Write a short program that declares and initializes some variables 5 Marks
e) Explain the TWO types of errors encountered in java 4 Marks
f) Explain the five operators found in java 5 Marks
g)
i) Define the term decision control structures 2 Marks
ii) Give a code snippet that illustrates the use of IF-ELSE STATEMENT in java
4 Marks
QUESTION TWO
a) Write code to demonstrating the use of SWITCH-STATEMENT 4 Marks
b) Using examples, explain the difference between WHILE-LOOP and DO-WHILE LOOP java
statement as repetition control structures 4 Marks
c)
i) How is an array declared in java 2 Marks
ii) Giving examples, explain the meaning of multidimensional arrays as used in java.
4 Marks
d) Explain the main differences between OBJECTS and CLASSES 4 Marks
e) What is the meaning of the term METHOD in java 2 Marks
QUESTION THREE
a) Explain the properties of a constructor 4 Marks
b) Outline three characteristics of java METHODS 3 Marks
c) In your own understanding, explain how to pass variables in methods .Giving examples
6 Marks
d) Explain the purpose of the following codes
i)
BufferedReader dataIn = new BufferedReader(new
InputStreamReader( System.in) ); 2 Marks
ii) try{
name = dataIn.readLine();
}catch( IOException e ){
System.out.println(“Error!”);
} 2 Marks
e) Explain the scope of a variable 3 Marks
QUESTION FOUR
a) Write the syntax of defining your own classes 2 Marks
b) Explain the properties of overloaded methods 4 Marks
c) Explain the concept of encapsulation 4 Marks
d)
i) Create a class called person with the following variables and methods respectively:Name and
address with protected modifier, as well as getName, getAddress, setName and setAddress
methods. Your class should include relevant constructors 6 Marks
ii) Create another class named Student that can inherit all the properties and methods of the
existing class Person. 4 Marks
QUESTION FIVE
a) Using examples describe the different types of access modifiers used in java programming
12
Marks
b) Explain the importance of interface as applied in java programming 4 Marks
c) Explain the following java features
i) Java Virtual Machine 2 Marks
ii) Garbage Collection 2 Marks

(Visited 63 times, 1 visits today)
Share this:

Written by