Professional Documents
Culture Documents
Midterm Exam
Midterm Exam
Midterm Exam
Q1:The following code which represents the content of the file Main.java contains some errors (or
bugs). Find the errors and explain them. Rewrite the code lines that contain the errors after
correcting them. What would be the output of the program after correction.
Q2:What are the differences between private, protected, and public access modifiers?
Q3:Can we declare a constructor as private for a given class? If yes, how can you declare an
instance (object) of that class? If no, why not?
Page 1 of 2
Faculty of Engineering
Programming Language III (JAVA) Computer & Control – 4 th Year
Mid-Term Exam
Dr. Sami AL -MAQTARI 05/02/2012
Page 2 of 2