Perl6 Object Oriented Cookbook (v0.2.1)  
Section 3: Working with Classes  
 
Recipe 3.4: Declaring a Private Class
Last Updated: Sep 8, 2003
Status: Draft
      Previous Page   Next Page

How important is this problem to you?
  (Login to Vote)
4.00 Rating, 1 Vote  

How acceptable is the proposed solution?
  (Login to Vote)
0.00 Rating, 0 Votes  

Problem:  

You want to declare a 'private' class; that is, a class that may only be used within a particular other class.

Solution:  

Place the new class in the class definition of the class that needs to use it:

class MyClass {
    class MyPrivateClass { ... }
    ...
}

Discussion:


Log In to Comment


Login / Edit User Info -- Copyright © 2002 Cognitivity -- Previous Page   Next Page