Questions tagged [inner-classes]

In object-oriented programming (OOP), an inner class or nested class is a class declared entirely within the body of another class or interface. However in Java, an inner class is a non-static nested class.

Inner classes

In object-oriented programming (OOP), an inner class or nested class is a class declared entirely within the body of another class or interface. However in Java, an inner class is a non-static nested class.

Resources

2328 questions
0
votes
3 answers

How do I declare the objects related to one class in other?

The error shows: no matching functions for call to birthday::birthday(). How else should I declare the objects of one class in another class? #include using namespace std; class birthday { public: birthday(int d,int m,int y) …
0
votes
1 answer

Inner Broadcast receiver does not work?

I create an inner receiver InnerReceiver public class MainActivity extends Activity{ ... class InnerReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { …
joy
  • 9
  • 2
0
votes
1 answer

Aliasing a nested class of a template

I have the following in a header file: template class RingDeque { ... struct Iterator { using reference = T&; reference operator*() const; } } and I want to implement the operator*() function in the cpp file. I currently…
Poseidon23
  • 23
  • 4
0
votes
2 answers

How to pass arguments to inner class with same object for Outer and Inner classes in Python3?

The below code works fine where I'm creating objects for Outer and inner classes individually and passing the arguments class Student: def __init__(self,name,rollno): self.name = name self.rollno = rollno def show(self): …
0
votes
0 answers

Understanding socket programming in Android (Java) with respect to Inner class methods

I am trying to establish a client connection to a TCP Socket Server. I have created a Client class which implements the Runnable interface, now within an Activity class im trying to initialize a Client object. The Activity class: public class…
SlimD
  • 23
  • 1
  • 7
0
votes
2 answers

How to check if class X is a nested class in class Y?

I'm currently working on a CLI abstraction layer, which abstracts CLI programs as classes in Python. Such CLI programs offer a structured way to enable and configure CLI parameters. It helps checking for faulty inputs and generated properly escaped…
Paebbels
  • 15,573
  • 13
  • 70
  • 139
0
votes
1 answer

Need to issue Card for the bank account using Random and Datetime module in python

I am working on a project where I have to issue card to each and every account that has been created, below are the methods that I have to create within the class to have the card issued and with an expiry date as mentioned in the below criteria ,…
Ash
  • 9
  • 3
0
votes
1 answer

How to modify objects of outer class from an inner class so as to retrieve class object from firebase

I am currently working on an Android project with Firebase integration however I am struggling with retrieving a class object from Firebase Realtime database because of Firebase listeners. Let me elaborate on my project so that you can get the main…
0
votes
2 answers

how to access access inner class __OnlyOne from outer

I am getting below error while accessing inner class __OnlyOne from outer. what is wrong here? I am trying to use a singleton design pattern here by creating only one instance of inner object to outer. Traceback (most recent call last): File…
myquest
  • 11
  • 5
0
votes
0 answers

How can i use inner class in outer class in Java?

Im trying to develop Bynary Tree on Java. I have 2 classes BynaryTreeMap and his inner class Elem. public class Main { public static void main(String[] args) { BinaryTreeMap tree = new BinaryTreeMap(22); …
Lanak
  • 23
  • 5
0
votes
2 answers

what is the substitute for this anonymous inner class?

btnOpen.setOnClickListener(new OnClickListener() { public void onClick(View v) { Toast.makeText(getBaseContext(), "Time selected:" + timePicker.getCurrentHour() + ":" +…
sanjay
  • 2,116
  • 3
  • 19
  • 25
0
votes
1 answer

Cannot refer to a non-final variable timePicker inside an inner class defined in a different method.where is the inner class??

public class MainActivity extends Activity { TimePicker timePicker; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
sanjay
  • 2,116
  • 3
  • 19
  • 25
0
votes
1 answer

Can we use a nested class for IBDesignable?

I am developing a graphic library in Swift. The code cannot be shared, but I made a sample here (see the button example, Radio buttons were dedicated to another question). I would like to have a namespace MyGraphicLibrary for my components:…
Carl Sarkis
  • 119
  • 6
0
votes
1 answer

How to compare objects of a nested class C#

I'm trying to implement a generic binary min heap. I have a minHeap class which represents the heap, and a nested Node class which represents nodes. So minHeap consists of Node objects. Node class has two attributes: some generic data and an integer…
McDonut
  • 1
  • 2
0
votes
2 answers

Name of enum in innerclass changes through WCF-service

I have a class Actions with an Enum in it [DataContract] public class Actions { [DataContract] public enum MailDirectLinkContent { [EnumMember] [DescriptionAttribute("Second account holder")] SecondAccountHolder =…
Koen
  • 2,501
  • 1
  • 32
  • 43
1 2 3
99
100