Will the following code compile?
 
public class CustomConvertor 
{ 
     public static string ToDate(out this DateTime dt) 
     { 
           return dt.ToShortDateString(); 
     } 
}
 
Explanation
No, it will not
1. Class that contains extension methods must be static.
2. Modifier "out" in the declaration of extension methods is not necassary.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести