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. What is the purpose of the File class?

    Answer: The File class is used to create objects that provide access to the files and directories of a local file system.

  2. Can an exception be rethrown?

    Answer: Yes, an exception can be rethrown.

  3. When does the compiler supply a default constructor for a class?

    Answer: The compiler supplies a default constructor for a class if no other constructors are provided.

  4. If a method is declared as protected, where may the method be accessed?

    Answer: Classes or interfaces of the same package or may only access a protected method by subclasses of the class in which it is declared.

  5. 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.

  6. What restrictions are placed on method overloading?

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

  7. 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.

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

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

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

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

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

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

« 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.