UNIVERSITY EXAMINATIONS: 2018/2019
EXAMINATION FOR DIPLOMA IN INFORMATION TECHNOLOGY
DIT 410: JAVA PROGRAMMING
MODE: FULL TIME/PART TIME
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.
b) Define a token as used in java language.
c) Describe any THREE types of tokens supported by java language.
d) Java is regarded as a platform-neutral language. Explain.
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.
f) Explain any THREE differences between object oriented programming and procedure
g) Define bytecode as used in java and explain its role in java programming.
h) Outline FOUR conventions followed when naming identifiers in java.
QUESTION TWO[20 MARKS]
a) Define the term type casting as used in java language.
b) Explain the role of type casting in java programming.
c) Briefly explain the use of the following java modifiers.
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
QUESTION THREE [20 MARKS]
a) Define a wrapper class as used in java langauge.
b) Complete the following table of primitive types using the corresponding wrapper class for
c) Explain the concept of inheritance as used in java programming.
d) Explain two advantages of inheritance as used in java programming.
e) Write a java program to read ten integers, store them in a one dimensional array then sort and
display them in discending order.
QUESTION FOUR [20 MARKS]
a) Differentiate between a class variable and instance variable in java.
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.
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.
d) Write a java program to print integers that are multiples of three between 2 and 61.
QUESTION FIVE [20 MARKS]
a) Differentiate between order of precedence and associativity as used in java operators.
b) Describe the complete life cycle of a thread in java.
c) Compare and contrast an interface and a class in java programming.
d) Differentiate between method overriding and method overloading.
e) Explain any three exceptions that may occur in a java program.