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 does it mean that a method or field is static?

    Answer: Static variables and methods are instantiated only once per class.In other words they are class variables, not instance variables.If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class.Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too).Thats how library methods like System.out.println() work.out is a static field in the java.lang.System class.

  2. How do I convert a numeric IP address like 192.18.97.39 into a hostname like java.sun.com?

    Answer: String hostname = InetAddress.getByName(\"192.18.97.39\").getHostName(); Difference between JRE/JVM/JDK?

  3. Why do threads block on I/O?

    Answer: Threads block on i/o (that is enters the waiting state) so that other threads may execute while the I/O operation is performed.

  4. What is synchronization and why is it important?

    Answer: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources.Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that objects value.This often leads to significant errors.

  5. Which characters may be used as the second character of an identifier,but not as the first character of an identifier?

    Answer: The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

  6. What modifiers may be used with an inner class that is a member of an outer class?

    Answer: A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

  7. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?

    Answer: Unicode requires 16 bits and ASCII require 7 bits.Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits.UTF-8 represents characters using 8, 16, and 18 bit patterns.UTF-16 uses 16-bit and larger bit patterns.

  8. What are wrapped classes?

    Answer: Wrapped classes are classes that allow primitive types to be accessed as objects.

  9. What restrictions are placed on the location of a package statement within a source code file?

    Answer: A package statement must appear as the first line in a source code file (excluding blank lines and comments).

  10. What is the difference between preemptive scheduling and time slicing?

    Answer: Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence.Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks.The scheduler then determines which task should execute next, based on priority and other factors.

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