Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the dollar sign at the end of a class mean in Eclipse MAT?

I am using Eclipse MAT to try and track down a resource leak in Android (if you change screen orientation a lot) and when I go to the histogram view, I see my activity listed along with the same activity listed again and again with a $ after it.

So like:

com.test.TestActivity
com.test.TestActivity$1
com.test.TestActivity$2
com.test.TestActivity$3

Just wondering what the $1, $2 and $3 means...

tia.

like image 788
user645402 Avatar asked Feb 01 '12 21:02

user645402


People also ask

Why is there a dollar sign at the end of accounts?

All computer accounts in Active Directory have a dollar sign appended to the end of the name. That is a requirement for computer accounts. It helps distinguish them from user accounts (when looking at some management consoles such as Computer Management).

What does a dollar sign mean in a path?

A dollar sign doesn't have any special meaning in a path—it's interpreted as a normal character. It is often seen as part of a path for an administrative share, e.g., \C$&] for the C drive.

What does a dollar sign mean in a session name?

I noticed that one of the "sessions" was the name of a machine, and it was suffixed with a dollar sign. I remember that this means "hidden" with respect to files. But what does it mean with respect to a machine name in "sessions"? I have also seen this over the years. Computers establish sessions just like users.

What does the dollar sign mean in a regular expression?

When used in a regular expression, the dollar sign is used to represent the end of the line or string. For example, in the following Perl code, if the user's input stored in the $input variable ends with the "example," it would print "I see example." to the screen. What is functional programming?


1 Answers

They are anonymous inner classes.

For example:

Button button = (Button) findViewById(R.id.Button);  
button.setOnClickListener(new View.OnClickListener() {  
    public void onClick(View v) {  
        // ...
    }  
});

In this example the anonymous inner class is the subclass of View.OnClickListener.

like image 125
Matt Ball Avatar answered Nov 15 '22 19:11

Matt Ball