Java BS Mid Paper 2014
Java BS Mid Paper 2014
Java BS Mid Paper 2014
CS & IT Department
CS-4110 JAVA Software Development Paradigm
Mid Examination: Date: 11/04/2014
Course Dr. Muhammad Atif Computer allowed No
Instructor Ms. Iram Noreen
Exam Type Closed Book Calculator allowed No
Time Allowed 90 minutes Max. Marks 60
General Instructions
1. Please make sure your mobile is OUTSIDE the examination hall.
2. You have to answer all the questions until advised otherwise. Use fountain pen or ball
point to answer the questions.
3. Over writing and cutting is not allowed in sections.
4. You can ask for additional sheets for the descriptive part of the paper.
5. While answering descriptive questions please be precise and to-the-point.
6. All the queries about this paper must be asked in first 30 minutes. No query shall be
entertained after this time. If you don’t understand anything use your best guess and
answer the question.
7. Any use of unfair means (copying, cheating, exchanging any items etc) during the paper
shall DISQUALIFY you from this exam immediately, NO EXCEPTIONS.
8. Absolutely NO TALKING or WHISPRING during the exam.
9. Attach your admit slip, Question paper and answer sheet in top to bottom order.
}
}
public class B extends A {
public B() {
System.out.println("B");
}
Void arslan (){
System.out.println("TAlha");
}
public class Test {
7. Consider the following few lines of code, determine its output. (2)
String s1 = new String(“hi”);
String s2 = "hi";
System.out.println(s1 ==s2);
System.out.println(s1.equals(s2));
A. false true
B. true false
C. true true
D. None of the above.
11. (5 marks)
public class Test6{
public Test6(){
super(4);
}
public Test6(int var){
System.out.println(var);
}
public static void main(String[] args){
Test6 t6 = new Test6();
}
}
12. (5 marks)
13. (5 marks)
System.out.println(I.k);
class I{
int k=100;
A. 1 B. 2 C. 3 D. many
1. 11.
2. 12.
3. 13.
Part C : / 6
4. (1 mark each)
5. 14.
6. 15.
7. 16.
8. 17.
9. 18.
10. 19.
20.
Part D: / 10
Answer Table: (Use capital letters to answer the correct option of MCQs.)