Sunday, December 13, 2015

M. C. M. (Semester - II),University Of Pune Question Paper,2010 Question Paper,BASIC JAVA

University Of Pune Question Paper
M. C. M. (Semester - II) Examination - 2010
BASIC JAVA
(New 2008 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Q. Nos. 1 and 8 are compulsory.
(2) Solve any five from the remaining.
Q.1) Justify your answer : [12]
(a) Select correct options :
(i) Interface must have at least one method.
(ii) Interface can have only abstract methods.
(iii) Interface can have constants.
(iv) Interface can have hierarchy.
(b) Select correct options :
Interface MyConstants
{ Int r = 42;
Int s = 69;
// insert code
}
Select which of the following codes can be inserted at insert
code comment line which will not generate errors :
(i) Final double c = 2*Math.PI*r;
(ii) int area = r*s;
(iii) int result = result + r + s;
(iv) public static Main = 20;
(v) protected int code = 311;
[3877]-204 1 P.T.O.
(c) What will be the output ?
public class Super {
public static String greet(){
return “Pune”;
}//greet
 public String getName(){
return “University”;
}//getName
}//super
class Sub extends Super{
public static String greet(){
return “Banaras”;
}//greet
public String getName(){
return “Vidyalaya”;
}//getName
}//sub
public class Demo{
public static void main(String[] args)
{ Super s = new Sub();
System.out.print\n(s.greet() + “ ” + s.getName());
}
}
(d) When thread will die ? (Select correct answer)
(i) Execution of run() method ends
(ii) Sleep () is called
(iii) Wait () is called
(iv) Execution of thread’s constructor ends
[3877]-204 2 Contd.
Q.2) Write INTS class which has 2 integers as instance variables, print()
method, compare () method which will compare 2 objects, overloaded
constructors. Create 3 different objects. [10]
Q.3) Write an awt application which will accept rollno, name and marks
of the student in three text fields. When add button is clicked the
contents of text fields should be added in list. [10]
Q.4) Write a threaded applet which will display circle with different colours.
Colour will change after 1 second. Accept radius of the circle as
parameter. [10]
Q.5) Write an application which will accept 5 strings from command line.
If any of the strings is palindrome then throw “GotPalindrom” user
defined exception. [10]
Q.6) Write an application which will accept 2 file names using BufferedReader.
Then swap contents of those files. Do necessary validations. [10]
Q.7) Write code snippet : [10]
(a) Set layout of frame as grid with 4 columns and 5 rows.
(b) Anonymous class to close Window.
(c) Find first occurrence of character “U” in the string “Pune
University”.
(d) Call sleep method for 100 milliseconds.
(e) Check whether file “abc.txt” is readable or not.
Q.8) Write short notes : (Any Two) [08]
(a) Thread Synchronisation
(b) Access Modifiers
(c) Hash Table
Share This

B.E Civil Engineer Graduated from Government College of Engineering Tirunelveli in the year 2016. She has developed this website for the welfare of students community not only for students under Anna University Chennai, but for all universities located in India. That's why her website is named as www.IndianUniversityQuestionPapers.com . If you don't find any study materials that you are looking for, you may intimate her through contact page of this website to know her so that it will be useful for providing them as early as possible. You can also share your own study materials and it can be published in this website after verification and reviewing. Thank you!

Related Posts

0 comments:

Pen down your valuable important comments below

Search Everything Here