Tag: programming languages
Questions Related to programming languages
If you call the interrupted() method of a thread object twice the second call will always return false.
Which of these are valid contructors of a Thread object.
public class test { Line 1. public static void main(String [] a) { Line 2. assert a.length == 1; Line 3. } Line 4. } Which two will produce an AssertionError? (Choose two.) A. java test B. java -ea test C. java test file1 D. java -ea test file1 E. java -ea test file1 file2 F. java -ea:test test file1
Line 1. public class ClassA { Line 2. public void count(int i) { Line 3. count(++i); Line 4. } Line 5. } And: Line 6. ClassA a = new ClassA(); Line 7. a.count(3); Which exception or error should be thrown by the virtual machine? A. StackOverflowError B. NullPointerException C. NumberFormatException D. IllegalArgumentException E. ExceptionlnlnitializerError