Jump to content

Inner classes: Difference between revisions

m
Fixed typos.
m (→‎{{header|Raku}}: Add a Raku example)
m (Fixed typos.)
Line 2:
 
;Definition
In [[wp:Object-oriented_programming|object-oriented programming]], an '''inner''' or '''nested class''' class is a class declared entirely within the body of another class or interface.
 
It is not the same as a '''subclass''' which is a class which inherits members from another class or classes and can be declared anywhere the parent class(es) are within scope. However, inner classes may nevertheless be subclasses of other classes as well.
Line 11:
Illustrate your answer by creating an inner class with a constructor, an instance method and field and show how to instantiate it.
 
If youyour language does not support the object oriented paradigm, you may either omit this task or describe (and substitute in your example) any equivalent structure(s) which the language does have.
 
;Reference
9,485

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.