Tag Archives: methods

Java Notes-4

Note that, in certain situations an Inner class may not be able to extend some other particular class (for eg. a static inner class cannot extend another non-static inner class in the same class). But in general there is no … Continue reading

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

Frequently Asked Questions in Java Part-14

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: What is the importance of static variable? Answer: static variables are class level variables where all objects of the class refer to the … Continue reading

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

Frequently Asked Questions in Java Part-13

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: Java Runtime Environment (JRE): Answer: A subset of the Java Development Kit (JDK) for end-users and developers who want to redistribute the runtime … Continue reading

Posted in Java | Tagged , , , , , , , | 3 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-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

Java Notes-3

You need a boolean in the if condition. An overriding method only needs to declare that it can throw a subset of the exceptions the overriden method can throw. Having no throws clause in the overriding method is OK. Normal … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | 4 Comments

Frequently Asked Questions in Java Part-2

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: What is a task’s priority and how is it used in scheduling? Answer: A task’s priority is an integer value that identifies the … Continue reading

Posted in Java | Tagged , , , , , , , | 11 Comments

Frequently Asked Questions in Java Part-1

Disclaimer: “Sources Unknown”; Compilation only; I compiled it from various sources When I was exploring Java. Question: When you declare a method as abstract method ? Answer: When i want child class to implement the behavior of the method. Question: … Continue reading

Posted in Java | Tagged , , , , , , , , | 6 Comments

Writing Custom Task in Ant

Writing Own Task Create a Java class that extends org.apache.tools.ant.Task For each attribute, write a setter method that is public void and takes a single argument Write a public void execute() method, with no arguments, that throws a BuildException — … Continue reading

Posted in Ant, How To..., Java | Tagged , , , , , , , , , , , , , | 4 Comments