Free Jobs
Reference




Java 7 Interview Questions Answers

For more advanced and tough Java 7 Interview Questions Click Here



Q1. What is JLayer in context of Swing in Java SE 7
JLayer in context of Swing in Java SE 7 is a decorator for Swing components
that enables us to implement many advanced painting effects and also
lets us receive notifications of AWTEvents generated within its borders.

Q2. What is the work of LayerUI object in JLayer in Java SE 7
LayerUI object actually performs the actual decoration of
the painting and input events delegated to it by JLayer.

Q3.How to use javax.swing.JLayer and javax.swing.plaf.LayerUI class to decorate a panel in java SE7
For decorating a JPanel object we can do as below:
JFrame sampleFrame = new JFrame();
JPanel samplePanel = createPanel();
LayerUI<JPanel> sampleLayerUI = new SampleLayerUISubclass();JLayer<JPanel>
sampleLayer = new JLayer<JPanel>(samplePanel, sampleLayerUI);
sampleFrame.add (sampleLayer); This way we can decorate a panel in java.

Q4. Why javax.swing.JLayer class is final and how to incorporate the custom behaviour in java SE7
javax.swing.JLayer class is final because the custom behavior is encapsulated in the
LayerUI subclass and thus there is no need to make a JLayer subclass.
and JLayer incapsulates the LayerUI class


Q5. What is the difference between HeavyWeight and LightWeight graphics component in java SE7
There are two types of graphics component in java
1.HeavyWeight component:heavyweight components are components from java.awt package
for example Button and Label.
2.LightWeight component:LightWeight components are Components from the javax.swing package
for example JButton and JLabel

Q6. When to use newBufferedReader and readAllBytes to read files in Java SE 7
If file is very samll use readAllBytes method and if file is text file
use newBufferedReader to read the file.

Q7. What are the new features of JDBC 4 1 in Java SE 7
There are following new features of JDBC 4.1 in Java SE 7
1.JDBC 4.1 can now use try with resources statement to automatically close Connection,
ResultSet, and Statement types of resources.
2.The RowSetFactory interface and the RowSetProvider class is intorduced
that can be used to create all types of row sets supported by JDBC driver.

Q8. What is the difference between DriverManager setLogWriter and DataSource setLogWriter
Both the DriverManager.setLogWriter and DataSource.setLogWriter are methods to enable
tracing for JDBC connection However if DriverManager facility is used to establish database connection
use DriverManager.setLogWriter method for tracing and if DataSource object is used to get the
connection use DataSource.setLogWriter method to enable tracing


Q9. What is JDBC tracing and how to enable it
JDBC tracing is a tool To debug error issues related to JDBC connection.
It contains a listing of all happenings in the system for the operations of JDBC.
DriverManager.setLogWriter or DataSource.setLogWriter can be used to enable
tracing depending upon the database connection methods.

Q10. How to debug error issues related to JDBC connection
To debug error issues related to JDBC connection first thing to do is to enable JDBC
tracing.Tracing contains a listing of all happenings in the system for the operations of JDBC.



For more advanced and tough Java 7 Interview Questions Click Here












www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)