Wednesday, May 22, 2019

Most Frequently asked questions series 10

1)  Which is true about a method-local inner class? (Java)
a. It must be marked final.
b. It can be marked abstract.
c. It can be marked public.
d. It can be marked static.

2) Which constructs an anonymous inner class instance? (Java)
a. Runnable r = new Runnable() { };
b. Runnable r = new Runnable(public void run() { });
c. Runnable r = new Runnable { public void run(){}};
d. System.out.println(new Runnable() {public void run() { }})

3)  Which of the following allows the programmer to destroy an object x? (Java)
a. x.delete()
b. x.finalize()
c. Runtime.getRuntime().gc()
d. Only the garbage collection system can destroy an object.

4) Which of the following statements are correct? (Java)
a. If multiple listeners are added to a component only events for the last listener added will be processed
b. If multiple listeners are added to a component the events will be processed for all but with no guarantee in the order
c. Adding multiple listeners to a comnponent will cause a compile time error
d. You can not remove or add listeners to a component.

5) Which of the following methods are members of the Vector class and allow you to input a new element? (Java)
a. addElement
b. insert
c. append
d. addItem

6)  What is the default return-type of getchar()? (C programming)
a. char
b. int
c. char *
d. Reading character doesn't require a return-type

7) The Bedrock that supports software Engineering in layered technology.
a. Methods
b. Tools
c. Process
d. Quality Focus

Answers:
1) b
2) d
3) d
4) b
5) a
6) b
7) d

No comments:

Post a Comment