A private class is a class that cannot be directly accesed from outside its outer class, similar to a private variable or method. This means that a private class must always be an inner class, though an inner class can be public or protected instead.
For instance, the following is valid and means that any X object cannot directly access the inner Y class.
public class X
{
private class Y{}
}
The following however is invalid.
private class X{}
A class can either be default or public it can never be declared as private, so the question of abstract class at the file level does not arise. But an inner class can be declared private and abstract as well.
Base class should no knowledge about derived classes. The "private" modifier on a data member means private to the class which defined it. Base class cannot directly reference/access the private data member of the derived class, and the derived classes cannot access the private data member defined in the base class. Either way the accessing the private data member should be done via properties or getters
yes it is possible to make a private class in C++ but this class will not solve any purpose.................
no you can have a class with no public methods and even with a a private constructor public class Example { //constructor private Example(){ } }
Inner classes are very useful for classes that are written specifically to be used with the encompassing class. A good example of this would be a LinkedListNode class being part of a LinkedList class: public class LinkedList { private LinkedListNode root; private class LinkedListNode { private Object data; private LinkedListNode nextNode; } } No class except your LinkedList class needs to know anything about the LinkedListNode class. So we hide it so no one else needs to worry about what it does.
How to abbreviate Private First Class
A private variable is something that is not visible outside the class. A private class is one that cannot be inherited
Yes a private first class has the right to drop a private under permission of a sergent or higher
A class can either be default or public it can never be declared as private, so the question of abstract class at the file level does not arise. But an inner class can be declared private and abstract as well.
no, im private first class and i dont have it. and that is level 4 (private first class)
Base class should no knowledge about derived classes. The "private" modifier on a data member means private to the class which defined it. Base class cannot directly reference/access the private data member of the derived class, and the derived classes cannot access the private data member defined in the base class. Either way the accessing the private data member should be done via properties or getters
yes it is possible to make a private class in C++ but this class will not solve any purpose.................
no you can have a class with no public methods and even with a a private constructor public class Example { //constructor private Example(){ } }
Private first class in the Army Guard, and Airman first class in the Air Guard.
The rank is simply Private (E2), referred to informally sometimes as "second class". There are three grades of Private in the Army - Private (E1), which wears no rank insignia, Private (E2), which wears one chevron, and Private First Class (E3), which wears one chevron and one rocker.
Yes. However, ONLY nested classes (as in sub-classes of a top-level class) could be declared as private. The main (top-level) class cannot be private as it couldn't be accessed.
Inner classes are very useful for classes that are written specifically to be used with the encompassing class. A good example of this would be a LinkedListNode class being part of a LinkedList class: public class LinkedList { private LinkedListNode root; private class LinkedListNode { private Object data; private LinkedListNode nextNode; } } No class except your LinkedList class needs to know anything about the LinkedListNode class. So we hide it so no one else needs to worry about what it does.