imp java interview questions

Upload: madhudevu9837

Post on 02-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Imp Java Interview Questions

    1/2

    Basic Java interview questions

    1. What is a Marker Interface?- An interface with no methods. Example: Serializable,

    Remote , Cloneable

    2. What interface do you implement to do the sorting?- Comparable

    3. What is the eligibility for a object to get cloned?- It must implement the Cloneableinterface

    4. What is the purpose of abstract class? - It is not an instantiable class. It proides the

    concrete implementation for some!all the methods. So that the" can reuse the concretefunctionalit" b" inheritin# the abstract class.

    5. What is the difference between interface and abstract class?- Abstract class defined

    with methods. Interface will declare onl" the methods. Abstract classes are er" muchuseful when there is a some functionalit" across arious classes. Interfaces are wellsuited for the classes which aries in functionalit" but with the same method si#natures.

    6. What do you mean by RMI and how it is useful? - R$I is a remote method inocation.

    %sin# R$I, "ou can wor& with remote ob'ect. (he function calls are as thou#h "ou areino&in# a local ariable. So it #ies "ou a impression that "ou are wor&in# reall" with a

    ob'ect that resides within "our own )*$ thou#h it is somewhere.7. What is the protocol used by RMI?- R$I-II+

    8. What is a hashCode?- hash code alue for this ob'ect which is uniue for eer" ob'ect.

    9. What is a thread?- (hread is a bloc& of code which can execute concurrentl" with other

    threads in the )*$.

    10. What is the algorithm used in Thread scheduling? - ixed priorit" schedulin#.

    11. What is hash-collision in ashtable and how it is handled in !a"a? - (wo different

    &e"s with the same hash alue. (wo different entries will be &ept in a sin#le hash buc&etto aoid the collision.

    12. What are the different dri"er types a"ailable in !#$C?- /. A )01C-+01C brid#e 2. A

    natie-AI partl" )aa technolo#"-enabled drier 3. A net-protocol full" )aa technolo#"-enabled drier 4. A natie-protocol full" )aa technolo#"-enabled drier or more

    information: 0rier 0escription13. Is !#$C-%#$C bridge multi-threaded?- 5o

    14. #oes the !#$C-%#$C $ridge support multiple concurrent open statements per

    connection?- 5o

    15. What is the use of seriali&able?- (o persist the state of an ob'ect into an" perminant

    stora#e deice.

    16. What is the use of transient?- It is an indicator to the )*$ that those ariables should

    not be persisted. It is the users responsibilit" to initialize the alue when read bac& fromthe stora#e.

    17. What are the different le"el lockings using the synchroni&ation keyword? - Class

    leel loc& +b'ect leel loc& $ethod leel loc& 1loc& leel loc&

    18. What is the use of preparedstatement?- reparedstatements are precompiled

    statements. It is mainl" used to speed up the process of insertin#!updatin#!deletin#especiall" when there is a bul& processin#.

    19. What is callable statement? Tell me the way to get the callable statement? -

    Callablestatements are used to ino&e the stored procedures. 6ou can obtain thecallablestatement from Connection usin# the followin# methods prepareCall7Strin# sl8prepareCall7Strin# sl, int resultSet("pe, int resultSetConcurrenc"8

    20. In a statement' I am e(ecuting a batch) What is the result of the e(ecution? - It

    returns the int arra". (he arra" contains the affected row count in the correspondin# indexof the S9.

    http://www.feucos.com/resource/intertech/java/javaint_5.htmhttp://www.feucos.com/resource/intertech/java/javaint_5.htmhttp://www.feucos.com/resource/intertech/java/javaint_5.htmhttp://www.feucos.com/resource/intertech/java/javaint_5.htmhttp://www.feucos.com/resource/intertech/java/javaint_5.htmhttp://www.feucos.com/resource/intertech/java/javaint_5.htm
  • 8/10/2019 Imp Java Interview Questions

    2/2