answersLogoWhite

0


Best Answer

Anonymous classes are the temporary classes that contain some constant member variables like -

var Student = new { ID = 2, Name = "Madhuri" }

We also have anonymous methods in .Net-
Anonymous methods is a new feature in C# 2.0 that lets you define an anonymous method called by a delegate.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is anonymous class in .Net?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an anonymous class in oops?

class is defined in the class


What is an anonymous class?

An anonymous class is a local class without a name. An anonymous class is defined and instantiated in a single succinct expression using the new operator. While a local class definition is a statement in a block of Java code, an anonymous class definition is an expression, which means that it can be included as part of a larger expression, such as a method call. When a local class is used only once, consider using anonymous class syntax, which places the definition and use of the class in exactly the same place.New Syntax for Anonymous ClassesWe've already seen examples of the syntax for defining and instantiating an anonymous class. We can express that syntax more formally as: new class-name ( [ argument-list ] ) { class-body }or: new interface-name () { class-body }


What is the purpose of anonymous class?

An anonymous class allows you to bind an unnamed ("anonymous") class for the purpose of leaving your class namespace relatively uncluttered in the source code. This is usually reserved for small classes with a simple function that is "inlined" into a larger class in order to make the source code smaller, albeit slightly less readable. While classes of any size may be anonymous, they should be small in size to avoid making the code less readable.


Which is super class in .net?

System.object is for .Net system.Web.UI is for asp.net


What ananomus classes in java?

An Anonymous class in Java is one that does not have a name. It is usually created inside a class


How is interface instantiated in anonymous class for example new ActionListener?

They key word here is anonymous class. While ActionListener may be an interface, the anonymous class would be a subclass of ActionListener. It would be like creating a new class which implements ActionListener.JButton button = new JButton("Press Me!");button.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent ev) {System.out.println("PRESS");}});


What is the top NET class that everything is derived from?

It is System.Object class.


What is base class in .net?

object


What is the meaning of anonymous classes for events in java?

Anonymous classes, basically, have no name. It combines the class declaration and the creation of an instance of the class in one step. If an event handler is not shared by multiple components there is no need to declare a class to handle the event. The handler can be implemented with the use of an anonymous inner class. i.e. : button1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, "You clicked button1."); } });


Which is true about an anonymous inner class?

A lot of things are true about them. What is it that you want to know?


As quickly possible change one letter in soot?

The answer is Soon so anonymous and i know you anonymous you are in my class.


Which class is used to define the controls in c?

In .NET, the class name is System.Windows.Forms.Control