Tag Archives: Programming

Java Notes-6

interface I { int i = Test.out(“i”, 1); int ii = Test.out(“ii”, 2); }interface J extends I { int j = Test.out(“j”, 3), jj = Test.out(“jj”, 4); }interface K extends J { int k = Test.out(“k”, 5); }class Test { … Continue reading

Posted in Java | Tagged , , , , , , , , , | 1 Comment

Frequently Asked Questions in Java Part-12

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: What are different types of inner classes? ANSWER:  Nested top-level classes, Member classes, Local classes, Anonymous classes Nested top-level classes- If you declare … Continue reading

Posted in Java, Uncategorized | Tagged , , , , , , , | 2 Comments

Frequently Asked Questions in Java Part-11

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: It is said that the code in a finally clause will never fail to execute, Is there any example where it fails to … Continue reading

Posted in Java | Tagged , , , , , , , | 2 Comments

Frequently Asked Questions in Java Part-10

Question: What are three ways in which a thread can enter the waiting state? Answer: A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object’s lock, or … Continue reading

Posted in Java | Tagged , , , , , , , | Leave a comment

Frequently Asked Questions in Java Part-9

Question: What are access modifiers Answer: These public, protected and private, these can be applied to class, variables, constructors and methods. But if you don’t specify an access modifier then it is considered as Friendly Question: Can protected or friendly … Continue reading

Posted in Java | Tagged , , , , , , , | 3 Comments

Frequently Asked Questions in Java Part-7

Question: What is the difference between notify and notify All methods ? Answer: A call to notify causes at most one thread waiting on the same object to be notified (i.e., the object that calls notify must be the same … Continue reading

Posted in Java | Tagged , , , , , , , | 2 Comments

Frequently Asked Questions in Java Part-6

Question: 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 … Continue reading

Posted in Java | Tagged , , , , , , , , | Leave a comment

Frequently Asked Questions in Java Part-5

Question: There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it? Answer: If these classes are threads I’d consider … Continue reading

Posted in Java | Tagged , , , , , , , , , , | 1 Comment

Frequently Asked Questions in Java FAQs Part-4

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: What types of values does boolean variables take It only takes values true and false. Which primitive datatypes are signed. Answer: All except … Continue reading

Posted in Java | Tagged , , , , , , , , , , , , , , , | 2 Comments

Frequently Asked Questions in Java Part-3

Question: What are the rules for object reference assignment and method call conversion? Answer: An interface type can only be converted to an interface type or to object. If the new type is an interface, it must be a super … Continue reading

Posted in Java | Tagged , , , , , , , , , , , | Leave a comment