Please UseAMeaningfulSubjectLine when posting. Explaining your question or remark briefly on the subject line allows us to know what we are getting into, and if we will be able to help. Taking the time to compose a useful subject line shows that you care enough about your question to ShowSomeEffort when asking it here.
Im getting confused with Queue Implementation and Linked List Implementation since both are the same.
There is *some* similarity, since LinkedList implements Queue, but they're not the same at all. For example, other implementations of the Queue interface have none of the methods in the List interface.
Ping & DNS - updated with new look and Ping home screen widget
1> Example of Queue Implementation and Linked List Implementation in Java. ? "Example Please"
2>If Strings are immutable then Can we override strings as below. Is the below Java program Valid and if so Why ? and If not then whats the reason for the same.
Joined: Mar 22, 2005
Example of Queue Implementation and Linked List Implementation in Java. ?
What do you mean by "implementation"? The Java class libraries have several classes that implement these interfaces; see the javadocs of Queue and List for which those are. >If you're looking for the source code of those classes, then somewhere in the JDK directory is a file called src.zip that contains the source code to all classes.
If Strings are immutable then Can we override strings as below. Is the below Java program Valid?
I'm not sure where you think you're overriding anything. You're calling those methods twice each as far as I can tell, and nothing else. The fact that you can assign a new value to a String reference has nothing to do with the fact that a String object is immutable. If you're unclear about these concepts I suggest to work through a beginner's book on Java; the Sun Java Tutorial also explains those concepts in the context of Java. Also read up on the difference of "value" and "reference" in an OO language.
Query 1:: Example for Queue Implementation and Linked List Implementation in Java. ?
My Comments : I meant that do you have any real time example where Queue can be used in java and some other real time example where i can think of opting for a linked list.
what are the advantages and dis-advantages of using the Queue and Linked List wrt Java ? Hope It's clear now.
Query 2: I got what your are saying,,Thanks for clarifying.