Answer Posted / narasimha
hi ,
look into this
Anonymous type is the type that is created anonymously.
Anonymous type is a class that is created automatically by
compiler in somewhere you can’t see directly while you are
declaring the structure of that class. Confusing? Let me
show you one example.
view plaincopy to clipboardprint?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
Person _person = new Person { ID = 1, FirstName
= "Michael", LastName = "Sync" };
Console.WriteLine("Name: {0} {1}", _person.FirstName,
_person.LastName);
Console.ReadLine();
}
}
public class Person {
public int ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
}
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
How do you make a thread in java?
Give an example of call be reference significance.
What is the output of the below java program?
Which is fastest collection in java?
What does a void function return?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
Can a lock be acquired on a class in java programming?
Can a vector contain heterogenous objects?
What are the 4 versions of java?
What is the major advantage of external iteration over internal iteration?
How do you write a conditional statement?
What does exclamation mean in java?
Are arrays classes in java?
How are java objects passed to a method and what are native methods?
Why singleton is not thread safe?