JAVA General Questions2
-
Upload
prerana-gutla -
Category
Documents
-
view
216 -
download
0
Transcript of JAVA General Questions2
-
7/26/2019 JAVA General Questions2
1/4
1. What are the principle concepts of OOP?
There are four principle concepts upon which object oriented design andprogramming rest. They are:
1. Abstraction2. Polymorphism
3. Inheritance. !ncapsulation
2. What is the dierence between and statement and a preparestatement in JDBC? Does the prepared statement do anythin otherthan allow !s to ha"e parameters #m!ltiple !ses$? %ow is thisdierent than a callable statement #!sed to call stored proced!res$?
&. What is 'prin ?
"pring is an open source framewor# created to address the comple$ity of enterpriseapplication de%elopment. &ne of the chief ad%antages of the "pring framewor# is its
layered architecture' which allows you to be selecti%e about which of itscomponents you use while also pro%iding a cohesi%e framewor# for (2!! applicationde%elopment.
1. What are the ad"antaes of 'prin framewor(?
The ad%antages of "pring are as follows:
1. "pring has layered architecture. )se what you need and lea%e you don*t neednow.2. "pring !nables P&(& Programming. There is no behind the scene magic here.P&(& programming enables continuous integration and testability.3. +ependency Injection and In%ersion of ,ontrol "impli-es (+,. &pen source and no %endor loc#/in.
2. What are some of the mod!les in 'prin?
"pring comprises of se%en modules:
1. The core container: The core container pro%ides the essential functionality ofthe "pring framewor#. A primary component of the core container is theean0actory' an implementation of the 0actory pattern. The ean0actory applies theIn%ersion of ,ontrol I&, pattern to separate an application*s con-guration anddependency speci-cation from the actual application code.
2. "pring conte$t: The "pring conte$t is a con-guration -le that pro%ides conte$tinformation to the "pring framewor#. The "pring conte$t includes enterpriseser%ices such as (+I' !(' e/mail' internali4ation' %alidation' and schedulingfunctionality.
3. "pring A&P: The "pring A&P module integrates aspect/oriented programmingfunctionality directly into the "pring framewor#' through its con-guration
-
7/26/2019 JAVA General Questions2
2/4
management feature. As a result you can easily A&P/enable any object managed bythe "pring framewor#. The "pring A&P module pro%ides transaction managementser%ices for objects in any "pring/based application. 5ith "pring A&P you canincorporate declarati%e transaction management into your applications withoutrelying on !( components.
. "pring +A&: The "pring (+, +A& abstraction layer o6ers a meaningfule$ception hierarchy for managing the e$ception handling and error messagesthrown by di6erent database %endors. The e$ception hierarchy simpli-es errorhandling and greatly reduces the amount of e$ception code you need to write' suchas opening and closing connections. "pring +A&*s (+,/oriented e$ceptions complyto its generic +A& e$ception hierarchy.
7. "pring &89: The "pring framewor# plugs into se%eral &89 framewor#s topro%ide its &bject 8elational tool' including (+&' ibernate' and iatis ";< 9aps. Allof these comply to "pring*s generic transaction and +A& e$ception hierarchies.
=. "pring 5eb module: The 5eb conte$t module builds on top of the application
conte$t module' pro%iding conte$ts for 5eb/based applications. As a result' the"pring framewor# supports integration with (a#arta "truts. The 5eb module alsoeases the tas#s of handling multi/part re>uests and binding re>uest parameters todomain objects.
?. "pring 9@, framewor#: The 9odel/@iew/,ontroller 9@, framewor# is a full/featured 9@, implementation for building 5eb applications. The 9@, framewor# ishighly con-gurable %ia strategy interfaces and accommodates numerous %iewtechnologies including ("P' @elocity' Tiles' iTe$t' and P&I.
&. Why do yo! need O)* tools li(e hibernate?
The main ad%antage of &89 li#e hibernate is that it shields de%elopers from messy";
-
7/26/2019 JAVA General Questions2
3/4
+. What is dierences between ),'-f!l web ser"ices and 'OP webser"ices?
Ans: Though both 8!"Tful web series and "&AP web ser%ice can operate crossplatform they are architecturally di6erent to each other' here is some of di6erencesbetween 8!"T and "&AP:
1 8!"T is more simple and easy to use than "&AP. 8!"T language is based on useof nouns and %erbs better readability2 8!"T uses TTP protocol for producing or consuming web ser%ices while "&APuses 9uest there isno need to ma#e it thread/safe or add synchroni4ation. 9ultiple clients can safelyaccess 8est0ull resources concurrently.
1. What are the dierences between ,- and PO'- in ),'-f!ll Web'er"ices?
2. What are the di desin approches to create 'OP based Web'er"ices?
Ans: Top/+own and ottom/)p design approches. They call it as ,ontract 0irst or,ontract
-
7/26/2019 JAVA General Questions2
4/4
3. %ow do yo! enable sprin transactions?4. %ow many ways to initiate 'prin transactions?Ans: Programatic and +eclarati%e.
5. What is criteria P6?
7. What is restriction and pro8ection?9. What are the dirent le"el CC%, le"els in %ibernate?1:. What are the di fetch strateries?11. What the Ordered collection and sorted collection in %ibernate?12. What is transient "ariable do in J;?1&. What is "olatile (ey word?1+. %ow do yo! ma(e s!re yo! application code thread safe?13. )ead abo!t di types of los in threads?