answersLogoWhite

0

Can an inner class be creatd?

Updated: 11/18/2022
User Avatar

Wiki User

13y ago

Best Answer

Yes.

public class My {

public class Wallet {

}

}

//To create one

My.Wallet billFolder = new My.Wallet();

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can an inner class be creatd?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Inner class oops?

Inner class oops is a program. This program is smaller class within a bigger class.


What is static inner class?

An inner class declared as static is treated as if it were a normal top-level class.


What are inner classes?

Quite simply, an inner class is one class within another. Typically the inner class will be a private inner class, and will only be used by the outer class. class MyOuterClass { class MyInnerClass { } }


Inner classes in java?

An inner class is a class within a class: class MyClass { class MyInnerClass { } } Inner classes in Java are normally used for things like the nodes of a linked list.


What is nested class?

A class declared as a member of another class is called as a nested class or a class with in class. the general syntax of the nested class is: class outer_class_name{ private: //data protected: //data public: //methods class inner_class_name{ private: //data of inner class public: //methods of inner class };//end of inner class };//end of outer class


Can interface have inner class?

Yes


When do you use inner classes?

You use inner classes when you know you'll never need to access that class from anywhere else. A common use of this is in a linked list implementation: public class LinkedList { private class LinkedListNode { } } There's no reason for any other class to have access to your node class, so it should be an inner class.


What is the mode of Mozart's a little night music?

mozart creatd his own mode


What is a private class?

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{}


How do you delete project blackout account?

PB account cannot be delete once you creatd it


What is inline declaration?

It is a declaration of java class in method body which called "inner class"


What happens when you declare class as a static in Java?

Declaring an inner class static means that class only has access to the "outer" class public and private static fields. A non-static inner class has access to the outer class's instance data. Top-level classes cannot be declared static. The advantage of a static inner class is that it doesn't need an instance of the containing class to work and it's bytecode class size is smaller for that reason - less overhead.