Java   View all facts   Glossary   Help
object > exception > programmer-created exception class
Next classpublic class    Upclass, exception    Previous classObject class   

programmer-created exception class comparison table
Subject have syntax rule receive model add declare protect wait on is a subtopic of create you create by name after access refer to see also extend notify has part provide place in represent inherit contain have example instantiate you send implement convert into import from order is a kind of share be a descendant of define specify by convert have access modifier refer to by hide have example of creation use override have syntax have benefit be a member of have have part return has definition throw when be communicate with is partitioned into
class
bold = mandatory
italic = non-terminal
normal font = optional
  0 or more methods to the methods it inherits from its superclassa list of variables, called instance variables, corresponding to data that will be present in each instanceits members from access by other classes or objects using an access modifier Classes  the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information'any public class in other packages  only one superclass  implementation for all its instance methods unless the class is abstractits own source fileseveral similar objectsbehaviour from its superclassdata associated with each object
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
create an instance of it more than one interface a packageelements as follows:
  1. class variables
  2. instance variables
  3. constructors
  4. the most important public methods
  5. methods that are simply used to access variables
  6. private methods
specification Object classa class type whose instances are the values of the class type1 class definition    an implements clause to declare that it contains methods for each of the operations specified by the interfacemethods that are inherited from the class's superclass
class classname
{ // declarations of variables
// declarations of constructors
// declarations of other methods with public ones first
}
1 named package rather than the default packagea unique name since somebody in the future might want to import the packages containing both classes and hence create a name clashconstructor A template that describes the data and behaviour of its instances called objects the unit of data abstraction in an object-oriented program abstract class, concrete class
exception messages from   0 or more condition variablesException Handlinguse the new operator
  • declaring and initializing it such that it is created whenever execution enters a particular block, or, in the case of an instance variable, when an instance is created, for example:
    String aString = "some text";
  • or by declaring it and initializing it later using the new operator, for example:
    String aString;
    aString = new String("some text");
 all instance variables of all objects of its classwithout reference to the instance variables contained in itException class other objects that a condition variable has changedpublic interface  any entity to which you can associate properties and behaviourinstance methods and instance variables from
  • the class to which it belongs
  • all that class's superclasses
   messages to a string using the toString method  objectone copy of each class variable of its class with the other instances of its class   itself to a string representation using the toString method several different variables at the same timemethods from other objects using the 'private' keywordString name = new String();     state that is maintained in its variables its class using the getClass methodAn event that happens during program execution that prevents the program from continuing normally; generally, an errorsomething goes wrong in the execution of a programdistinct from every other object even if they contain the same dataother objects by sending and receiving messagesunchecked exception, checked exception
programmer-created exception class
bold = mandatory
italic = non-terminal
normal font = optional
messages from0 or more methods to the methods it inherits from its superclassa list of variables, called instance variables, corresponding to data that will be present in each instanceits members from access by other classes or objects using an access modifier0 or more condition variablesException Handlinguse the new operator
  • declaring and initializing it such that it is created whenever execution enters a particular block, or, in the case of an instance variable, when an instance is created, for example:
    String aString = "some text";
  • or by declaring it and initializing it later using the new operator, for example:
    String aString;
    aString = new String("some text");
the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information'any public class in other packageswithout reference to the instance variables contained in itException classonly one superclassother objects that a condition variable has changedpublic interfaceimplementation for all its instance methods unless the class is abstractits own source fileseveral similar objectsbehaviour from its superclassdata associated with each object
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
create an instance of itmessages tomore than one interfacea string using the toString methoda packageelements as follows:
  1. class variables
  2. instance variables
  3. constructors
  4. the most important public methods
  5. methods that are simply used to access variables
  6. private methods
exceptionone copy of each class variable of its class with the other instances of its classObject classa class type whose instances are the values of the class type1 class definitionitself to a string representation using the toString methodseveral different variables at the same timemethods from other objects using the 'private' keywordString name = new String();an implements clause to declare that it contains methods for each of the operations specified by the interfacemethods that are inherited from the class's superclass
class classname
{ // declarations of variables
// declarations of constructors
// declarations of other methods with public ones first
}
1 named package rather than the default packagea unique name since somebody in the future might want to import the packages containing both classes and hence create a name clashconstructorits class using the getClass method something goes wrong in the execution of a programthe unit of data abstraction in an object-oriented programother objects by sending and receiving messages 

Next classpublic class    Upclass, exception    Previous classObject class