DIT410  JAVA PROGRAMMING .

UNIVERSITY EXAMINATIONS: 2018/2019
EXAMINATION FOR DIPLOMA IN INFORMATION TECHNOLOGY
DIT 410: JAVA PROGRAMMING
MODE: FULL TIME/PART TIME
ORDINARY EXAMINATIONS
DATE: MARCH.2019 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO.

QUESTION ONE[30 MARKS]
a) List any FIVE major differences between C language and java language.
5 Marks
b) Define a token as used in java language.
2 Marks
c) Describe any THREE types of tokens supported by java language.
3 Marks
d) Java is regarded as a platform-neutral language. Explain.
2 Marks
e) Java IO streams are flows of data you can either read from, or write to. In this regard define
the role of the following streams in java.
i. System.in
ii. System.out.
4 Marks
f) Explain any THREE differences between object oriented programming and procedure
oriented programming.
6 Marks
g) Define bytecode as used in java and explain its role in java programming.
4 Marks
h) Outline FOUR conventions followed when naming identifiers in java.
4 Marks
QUESTION TWO[20 MARKS]
a) Define the term type casting as used in java language.
2 Marks
b) Explain the role of type casting in java programming.
4 Marks
c) Briefly explain the use of the following java modifiers.
i. Volatile
ii. Transient
iii. Synchronized
iv. Strictfp.
8 Marks
d) Write a java program to read a non-zero integer then reverse its digits then display the
resultant number e.g. if the user keys in 953 the program will reverse the digits and display
359.
6 Marks
QUESTION THREE [20 MARKS]
a) Define a wrapper class as used in java langauge.
2 Marks
b) Complete the following table of primitive types using the corresponding wrapper class for
each type.


5 Marks.
c) Explain the concept of inheritance as used in java programming.
3 Marks
d) Explain two advantages of inheritance as used in java programming.
2 Marks
e) Write a java program to read ten integers, store them in a one dimensional array then sort and
display them in discending order.
8 Marks
QUESTION FOUR [20 MARKS]
a) Differentiate between a class variable and instance variable in java.
2 Marks
b) Package in Java is a mechanism to encapsulate a group of classes, sub packages and
interfaces. Describe three uses of a package in java.
6 Marks
c) In java language, a statement can be defined as a complete instruction to a computer to
perform some task. In this regard, describe the following types of java statements.
i. Empty statement.
ii. Selection statetement.
iii. Jump statement.
6 Marks
d) Write a java program to print integers that are multiples of three between 2 and 61.
6 Marks
QUESTION FIVE [20 MARKS]
a) Differentiate between order of precedence and associativity as used in java operators.
4 Marks
b) Describe the complete life cycle of a thread in java.
5 Marks
c) Compare and contrast an interface and a class in java programming.
4 Marks
d) Differentiate between method overriding and method overloading.
4 Marks
e) Explain any three exceptions that may occur in a java program.
3 Marks

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

Written by