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 ›› Java questions

Technical General Java Sample Questions

  1. Which non-Unicode letter characters may be used as the first character of an identifier?

    Answer: The non-Unicode letter characters $ and _ may appear as the first character of an identifier.

  2. What restrictions are placed on method overloading?

    Answer: Two methods may not have the same name and argument list but different return types.

  3. What is casting?

    Answer: There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

  4. What is the return type of a program's main() method?

    Answer: A program's main() method has a void return type.

  5. What class of exceptions are generated by the Java run-time system?

    Answer: The Java runtime system generates RuntimeException and Error exceptions.

  6. What class allows you to read objects directly from a stream?

    Answer: The ObjectInputStream class supports the reading of objects from input streams.

  7. What is the difference between a field variable and a local variable?

    Answer: A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.

  8. How are this() and super() used with constructors?

    Answer: this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

  9. What is the relationship between a method's throws clause and the exceptions that can be thrown during the method's execution?

    Answer: A method's throws clause must declare any checked exceptions that are not caught within the body of the method.

  10. Why are the methods of the Math class static?

    Answer: So they can be invoked as if they are a mathematical code library.

« Previous || Next »

Java Sample Question Number: 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-90| 91-100| 101-110| 111-120| 121-130| 131-140| 141-150| 151-160| 161-170| 171-180| 181-190| 191-200| 201-210| 211-220| 221-230| 231-240| 241-250| 251-260| 261-270| 271-280| 281-290| 291-300| 301-310| 311-320| 321-330
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.