answersLogoWhite

0


Best Answer

Type in "implements java.util.Collection" after the class name.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a Java class that implements the collection interface found in the java.util package?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the Difference between header file and package?

A package is just a mechanism for grouping objects, it is very similar to grouping items within a folder or directory on a file system. A class is found within a package, but this does not have an impact on the class' behavior (review the "package" access level for a slight exception). An interface, however, is a .java file that is used (implemented) by another class to tell the outside world that it conforms to a certain specification. For example, you might have a "Runnable" interface that has a "run()" method in it, by having a class that is "Runnable" (implements Runnable) anyone using that class knows that it must have a "run()" method defined. This is used when you have several different classes that have the same interface. Interfaces have more in common with abstract classes than they do with packages. An interface, by definition, cannot have any implemented methods; an abstract class, in contrast, can define some methods and leave some methods to be implemented by a subclass. Also, a class can implement many interfaces, but can only extend one (abstract) class. Answer by Sahe Alam Ansari, BCA. Nepal bhairahawa. Email: mrsahealam@gmail.com


What is package Explain steps to Create Package?

you intend to create a document using word processor package. explain the steps you will follow and the tools and features provided by the application you will apply


How do you add a class or an interface to a package in java?

Well, the process differs whether you are using either an IDE or the command line binaries. If you are using an IDE, then it is most likely that your IDE comes with extensive functionality for both managing and creating packages. Look under the "Packages" menu, or, when you are using Eclipse, just right click on the package name in the Package Explorer window and a flood of possibilities will come right up. If you are using the command line binaries, then there are 2 steps to putting your classes in a package. First, you have to put your class or interface in the appropriate folder structure. For example, if you are using the package com.foo.bar.beebop, then you have to put your class in a folder named beebop, which is in a folder named bar, which is in a folder named foo, which is in a folder named com, which is in your class directory. Then, you have to add a package statement, which is only allowed to be at the top of your class file. For example, if you're using the package com.foo.bar.beebop, then put the following statement at the top of your class: package com.foo.bar.beebop; Then skip a line, then come your import statements (if you have any), then stick in another line (if you have inport statements), then your class. Enjoy!


What is import.java.swing in java?

You tell Java where to look for classes by importing them. javax.swing is a package (collection of classes) which provides prebuilt classes for creating a graphical user interface.


What is awt in java?

java.awt is a standard package of Java. It is a GUI(Graphical User Interface) package, which has classes in it such as Frame, Panel, and Button. Most of the package was later replaced with the javax.swing package, which has most of the same classes, only with a J prepended to them (JFrame, JPanel, JButton). However the java.awt package still includes some event handlers that are considered standard in java (java.awt.event).

Related questions

What is the package and interfaces?

Package:- package is collection of related classes and interfaces which can be import in our program. There are different built in packages available in java.Package provide us a facility to create user define packages. Interfaces:- Interface is just like abstract class but the difference is that we can implements any no of interfaces in a single class .It is an alternative solution for multiple inheritance which is not available in java. Once we have implement the interface we can define methods of that interface in our class.


How do we save packages and interface in java?

with the package name syntax: <package name> with the interface name.


What is treemap in java?

A TreeMap is a class in the java.util package that implements the Map data structure - that is, it associates certain keys with their respective values. It stores the key-value pairs in a tree, which means that the keys must implement the Comparable interface. The put() and get() methods are used to manipulate the elements in the map. HashMap is another class in the java.util package that implements a Map, but it uses hashes to store the key-value pairs.


What is a collection of related classes called in java?

a package


How can you design package in java?

it's a collection of classes is called a package .its a collection classes and interfaces which provides high level of security


What is a vhdl package?

A package is a collection of types, constants, subprograms etc.These are usually intended to implement some particular service or to isolate a group of related items.In particular, the details of constant values and subprogram bodies can be hidden from users of a package, with only their interfaces made visible.A package may be split into two parts:a package declaration, which defines its interface, anda package body, which defines the deferred details.The body part may be omitted if there are no deferred details.The syntax of a package declaration is as follows:package_declaration ::=package identifier ispackage_declarative_partend [ package_simple_name ] ;


What is the difference between packet and package?

packet are the collection of similar types of things in fixed/small quantity and package is collection of different type of things in huge quantity.


Outlook Express is GUI or TUI?

Outlook Express, which is part of the Windows Package, is both a graphical user interface(GUI) and text-based user interface(TUI).


What is the synonym of bundle?

package, collection, bag, array, pack, quantity, stack


A software is a collection of individual programs sold as a single package?

A Suite


What is the Difference between header file and package?

A package is just a mechanism for grouping objects, it is very similar to grouping items within a folder or directory on a file system. A class is found within a package, but this does not have an impact on the class' behavior (review the "package" access level for a slight exception). An interface, however, is a .java file that is used (implemented) by another class to tell the outside world that it conforms to a certain specification. For example, you might have a "Runnable" interface that has a "run()" method in it, by having a class that is "Runnable" (implements Runnable) anyone using that class knows that it must have a "run()" method defined. This is used when you have several different classes that have the same interface. Interfaces have more in common with abstract classes than they do with packages. An interface, by definition, cannot have any implemented methods; an abstract class, in contrast, can define some methods and leave some methods to be implemented by a subclass. Also, a class can implement many interfaces, but can only extend one (abstract) class. Answer by Sahe Alam Ansari, BCA. Nepal bhairahawa. Email: mrsahealam@gmail.com


What is package Explain steps to Create Package?

you intend to create a document using word processor package. explain the steps you will follow and the tools and features provided by the application you will apply