0

How to create custom return type in c#

Hi there i want to know that hpw can i create custum return type in c#

1st Jan 2018, 3:49 PM
Preetesh Shirkar
Preetesh Shirkar - avatar
3 Answers
+ 7
what do you mean? you can return an 'custom' object but you can't define your own primitive data types
1st Jan 2018, 4:01 PM
Kamil
Kamil - avatar
+ 3
Hi, I think you would want to create a method, though what would you like to return?
1st Jan 2018, 3:51 PM
Tarantino
Tarantino - avatar
+ 1
Create an object or strict to hold the data. then create a method with the return type of that object/struct. Then return the a created object/struct of your created type. For example let's say I made the class person. My method would look like this. public person getPerson () { return new person() ; }
1st Jan 2018, 4:02 PM
josh mizzi
josh mizzi - avatar