C# Partial TypesC# provides a concept to write source code in separate files and compile it as a single unit. This feature is called partial types and included in C# 2.0. The partial keyword is used to create partial types. It allows us to write partial class, interface, struct and method in two or more separate source files. All parts are combined when the application is compiled. Let's see an example. Here, we are creating a partial class that includes a depositeAmount() function in the Customer.cs file and a withdraw() function in the Customer2.cs file. Both functions are stored in separate file and combined when compiled. C# Partial Class Example// Customer.cs // Customer2.cs Output: Current balance is: 2000 amount is deposited Available balance is: 3000 500 is withdrawn Available balance is: 2500 Next TopicC# Iterators |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India