There's a great class called LinkedList that implements the Queue interface. To get an instance of it, use the following code snippet:
import java.util.*;
Queue queue = new LinkedList<T>();
where T is the type of the objects that will go in the queue. Remember the parentheses, as they drove me crazy during one memorable day working out why exactly that same line, minus the parentheses, kept on throwing me a rather unintelligible error.
Example:
Queue<String> q = new java.util.LinkedList<String>()
q.add("a")
q.add("b")
q.add("c")
Calling q.getFirst() returns the value "a".
Likewise, to create a Last-in first out (LIFO) collection, you use a Stack (java.util.Stack).
Who create Java & when? Why he create java ? What are mane functions of it?
You can create games, desktop applications and mobile applications using Java programming language.
The main advantage is that you don't have to implement those collections yourself. Java provides very efficient implementations for dozens of collections.
barsanabegam
No. if you wish to create an object that you plan on using in a java program then the answer is NO. You cannot initialize an object of a Java class without calling the constructor.
You really don't want to do that. Swing is for desktop applications. If you want to create a website, use Java Server Faces or Applets, not Swing.
class is a blueprint which does not have its own existence but it can pass all of its feature to its child classes.
A java object is a collection of methods and properties defined in the Java programming language.
a package
Sure, We can design OS using java, c++ and even with C also but the main reason is the code will be very hectic and very lengthy tooo
basically packages are a collection or a directory of similar classes. there are some inbuilt packages in java which prove to be really useful like the java.lang package which automatically is imported into your program. in addition you can also create your own packages and its really simple to create them! :)
NO, we cannot create a contructor for an interface in java.