Java View all facts Glossary Help |
object > exception > programmer-created exception class |
programmer-created exception class | ||||
subject | fact |
programmer-created exception class | is a subtopic of Exception Handling | |
is a kind of class | ||
is a kind of exception | ||
class |
| |
| ||
adds 0 or more variables to the variables it inherits from its superclass | ||
adds 0 or more methods to the methods it inherits from its superclass | ||
can access any public class in other packages | ||
can be imported from a package | ||
can extend only one superclass | ||
can have a main method | ||
can have instances | ||
can have more than one constructor each of which has different sets of arguments | ||
can have the same name as another class if the two classes are not in the same package and their packages are never imported into the same file | ||
can implement more than one interface | ||
can override methods that are inherited from the class's superclass | ||
can protect its members from access by other classes or objects using an access modifier | ||
cannot inherit method implementations from an interface | ||
contains all of the code that relates to its objects including
| ||
contains data associated with each object | ||
declares a list of variables, called instance variables, corresponding to data that will be present in each instance | ||
defines | ||
defines a class type whose instances are the values of the class type | ||
has
| ||
has 0 or more subclasses | ||
has 1 superclass except Object class which has no superclass | ||
has behaviour that is specified by its instance methods | ||
has more specialized behaviour than a class farther up in the class hierarchy | ||
has public interface which contains its public instance variables and instance methods | ||
has benefit
| ||
has example public class HelloWorld { | ||
has part class name | ||
has part code | ||
has part constructor | ||
has syntax class classname | ||
inherits 0 or more methods from its superclass | ||
inherits 0 or more variables from its superclass | ||
inherits behaviour from its superclass | ||
is abstract if it has one or more abstract methods | ||
is the unit of data abstraction in an object-oriented program | ||
is a descendant of Object class | ||
is specified by 1 class definition | ||
may have access modifier | ||
provides implementation for all its instance methods unless the class is abstract | ||
represents several similar objects | ||
should be a member of 1 named package rather than the default package | ||
should be named after a thing its instances represent in the real world | ||
should be placed in its own source file | ||
should have a comment at the top describing the purpose of the class, how it should be used, its authors and its history of modification | ||
should have a unique name since somebody in the future might want to import the packages containing both classes and hence create a name clash | ||
should not be named after the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information' | ||
should order elements as follows: | ||
to instantiate you create an instance of it | ||
uses an implements clause to declare that it contains methods for each of the operations specified by the interface | ||
exception |
| |
is thrown when something goes wrong in the execution of a program | ||
see also Exception class | ||
access unit | has access mode | |
object | can be converted into a string using the toString method | |
can be referred to without reference to the instance variables contained in it | ||
can be referred to by several different variables at the same time | ||
can communicate with every object to which it has access through its public interface | ||
can convert itself to a string representation using the toString method | ||
can model | ||
can notify other objects that a condition variable has changed | ||
can receive messages from
| ||
can return its class using the getClass method | ||
can send messages to
| ||
can wait on 0 or more condition variables | ||
communicates with other objects by sending and receiving messages | ||
has example of creation String name = new String(); | ||
has part public interface | ||
hides methods from other objects using the 'private' keyword | ||
is created by
| ||
shares every instance method of its class with the other instances of its class | ||
shares its implementation with other instances of its class | ||
shares one copy of each class variable of its class with the other instances of its class | ||
to create you use the new operator | ||
syntactic unit | has syntax rule bold = mandatory |
Next class: public class Up: class, exception Previous class: Object class