JavaBeat
Search JavaBeat

Certification Kits
SCJP 1.5 Exam Questions
SCJP 1.6 Exam Questions
SCWCD 1.4 Exam Questions
SCWCD 5.0 Exam Questions
SCBCD 5.0 Exam Questions
SCJP 1.6 Links
SCJP 1.6 Home
What is new?
SCJP Books
Objectives
Mock Exams
NavigableSet
NavigableMap
GarbageCollection
Console
Finalize Method
Forums
Certification Links
SCJP 1.4
SCJP 1.5
SCJP 1.6
SCWCD 1.4
SCWCD 5.0
SCBCD 5.0
SCEA
SCEA 5.0
JavaBeat
Home
Articles
Tips
Code
QnA
Forums
400 Mock Questions on SCJP 1.6 - JUST Rs.250 or 10 USD
Send us mail to sales@javabeat.net
more details
Do you have paypal account? Click Here to pay now and get the questions.

SCJP 1.6 Mock Exams - Finalize method (5 Questions)

2) What will be the output of the following program?


package finalize;

public class Ques01 {

	public static void main(String[] args) {
		
		MyClass object = new MyClass();
		object = null;
	}
}


class MyClass {
	
	void finalize(){
		System.out.println("finalize");
		super.finalize();
	}
}
  1. The program will output 'finalize'.
  2. It is unsure that the finalize() method will be called by the Garbage Collector.
  3. As soon the object reference 'object' is set to null, there is a possibility that the method 'finalize()' will be called.
  4. The program will cause compile-time errors.

Get more questions on Finalize method

Answer

2) d.

The program will cause compile-time errors and the method finalize() is declared with scope 'protected' in the base class and it is impossible to reduce the visibility in the derived class.

400 Mock Questions on SCJP 1.6 - JUST Rs.250 or 10 USD
Send us mail to sales@javabeat.net
more details

Sponsors
Webmaster Hosting Forum
Java Jobs
Latest in DLinks
http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-ii-example.html
Quartz Job Scheduler -- Part 1 (Setting up development project in Netbeans 6.1 beta)
Flex Messaging with BEA Workshop Studio
SOA and Virtualization: How do They Fit Together?
Introduction to Enterprise Portals - Why they Benefit IT and the Business
BEA WebLogic Operations Control: Application Virtualization for Enterprise Java
Best Practices for Building Production Quality EAR Files
BEA's SOA Reference Architecture - A Foundation for Business Agility
Blueprint for Successful SOA Integration
Guardian - What a tool!

JavaBeat Media (2004-2008), India
javabeat home | About Us
our network : opensource softwares
Copyright © 2007 JavaBeat