answersLogoWhite

0

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

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the difference between the header file and the preprocessor directive in programming language cpp?

pata nhn


What is the different between header file and header pointer?

Header file is a file which is meant to be included into another file during compilation. Examples: string.h, stdio.h, inttypes.h. Header pointer is a pointer to an object called header (for example header of a linked list).


What is the difference between program and programing?

the program contains the which are coding like as our header file ,void main,library function etc.


How do you include classes and structures in header files in c plus plus?

Classes and structures can be put in a header file the same way you would use them in a main program; the only difference is that they are placed in a separate file, called a header file. Then, after creating a new file, include that new file with the definition by the use of the preprocessor #include statement.


What is the difference between using angular brackets in C language and double quotes in Cpp language to enclose header files?

When you includes any header file using "" that time compiler try to locate this file first from your program's local directory and then from library. But if you include the .h file using <> then compiler assumes you are including some library file.


What is the header file of graphics?

The header file of graphics in TurboC is graphics.h


What is the difference between file header and a file name extension?

A file header is a specific section at the beginning of a file that contains metadata about the file's format, structure, and content, allowing software to correctly interpret and process the data. In contrast, a file name extension is a suffix at the end of a file name (typically consisting of a period followed by a few letters, like .txt or .jpg) that indicates the file type to the operating system and helps users identify the appropriate application to open it. While the file header provides detailed information embedded within the file itself, the file name extension serves as a quick reference for users and systems.


How do you create a user defined header file?

Header files are not much different from usual cpp files. There are basically two different things. It's file extension: you need to choose "header file" when you create it or save as .h file. Second is header files do not have main() function. When you are done with you header file do not forger to include it in your project by writing preprocessor directive:#include "your_header_file.h"


What is the use of header file stdbool.h?

stdbool header file use for a new data type that is boolean value


Which header file is FILE declared in?

The FILE type is declared in stdio.h.


If a file header is lost or corrupted and an application needs that header to read the file how can you recover the contents of the file?

Not possible. Always make backup copies.


Difference between library file and header file?

EX: pgm #include<stdio.h> main() { printf("haiii"); } Header file: (1) contains the function(printf) declaration (2) during preprocessing, the printf function is replaced by the function declaration Library file : (1) contains the function(printf) definition (2) during linking, the function declaration is replaced with the function definition.obviously, everything will be in object while linking