>> Saturday, June 25, 2011
Q).Why do threads block on I/O?
A).Threads block on i/o (that is enters the waiting state) so that other threads may execute while the I/O operation is performed.
Q).What is synchronization and why is it important?
A).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 object’s value. This often leads to significant errors.
Q).Is null a keyword?
A).The null value is not a keyword.
Q).Which characters may be used as the second character of an identifier,but not as the first character of an identifier?
A).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.
Q).What modifiers may be used with an inner class that is a member of an outer class?
A).A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
Q).How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
A).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.
Q).What are wrapped classes?
A).Wrapped classes are classes that allow primitive types to be accessed as objects.
Q).What restrictions are placed on the location of a package statement within a source code file?
A).A package statement must appear as the first line in a source code file (excluding blank lines and comments).
Q).What is the difference between preemptive scheduling and time slicing?
A).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.
Q).What is a native method?
A).A native method is a method that is implemented in a language other than Java.
Q).What are order of precedence and associativity, and how are they used?
A).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.
Q).What is the catch or declare rule for method declarations?
A).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.
Q).Can an anonymous class be declared as implementing an interface and extending a class?
A).An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
Q).What is the range of the char type?
A).The range of the char type is 0 to 2^16 - 1.
A).Threads block on i/o (that is enters the waiting state) so that other threads may execute while the I/O operation is performed.
Q).What is synchronization and why is it important?
A).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 object’s value. This often leads to significant errors.
Q).Is null a keyword?
A).The null value is not a keyword.
Q).Which characters may be used as the second character of an identifier,but not as the first character of an identifier?
A).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.
Q).What modifiers may be used with an inner class that is a member of an outer class?
A).A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
Q).How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
A).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.
Q).What are wrapped classes?
A).Wrapped classes are classes that allow primitive types to be accessed as objects.
Q).What restrictions are placed on the location of a package statement within a source code file?
A).A package statement must appear as the first line in a source code file (excluding blank lines and comments).
Q).What is the difference between preemptive scheduling and time slicing?
A).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.
Q).What is a native method?
A).A native method is a method that is implemented in a language other than Java.
Q).What are order of precedence and associativity, and how are they used?
A).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.
Q).What is the catch or declare rule for method declarations?
A).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.
Q).Can an anonymous class be declared as implementing an interface and extending a class?
A).An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
Q).What is the range of the char type?
A).The range of the char type is 0 to 2^16 - 1.
0 comments:
Post a Comment