Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› Core Java Sample Questions

Technical Sample Questions : Java Sample Questions : Core Java Sample Questions

  1. What is a native method?

    Answer: A native method is a method that is implemented in a language other than Java.

  2. What are order of precedence and associativity, and how are they used?

    Answer: Order of precedence determines the order in which operators are evaluated in expressions.Associatity determines whether an expression is evaluated left-to-right or right-to-left

  3. What is the catch or declare rule for method declarations?

    Answer: If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.

  4. Can an anonymous class be declared as implementing an interface and extending a class?

    Answer: An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

  5. What is the range of the char type?

    Answer: The range of the char type is 0 to 216 - 1.

  6. What is transient variable?

    Answer: Transient variable can't be serialize.For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.

  7. Name the containers which uses Border Layout as their default layout?

    Answer: Containers which uses Border Layout as their default are: window, Frame and Dialog classes.

  8. What do you understand by Synchronization?

    Answer: Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time.In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object's value.Synchronization prevents such type of data corruption.
    E.g.Synchronizing a function:

    public synchronized void Method1 () {
    // Appropriate method-related code.

    E.g.Synchronizing a block of code inside a function:

    public myFunction (){
    synchronized (this) {
    // Synchronized code here.

  9. What is Collection API?

    Answer: The Collection API is a set of classes and interfaces that support operation on collections of objects.These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces.
    Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
    Example of interfaces: Collection, Set, List and Map.

  10. Is Iterator a Class or Interface? What is its use?

    Answer: Iterator is an interface which is used to step through the elements of a Collection.

« Previous || Next »

Core Java Sample Question Number : 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-87|
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.