Which statement is valid for the following C# code snippet?
Posted: Wed Jul 13, 2022 7:57 pm
advertisement
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
}
});
public class Generic<T>{ public T Field;}class Program{ static void Main(string[] args) { Generic<String> g = new Generic<String>(); g.Field = "Hi"; Console.WriteLine(g.Field); }}
a) Compile time error
b) Generic being a keyword cannot be used as a class name
c) Runtime error
d) Code runs successfully
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
}
});
public class Generic<T>{ public T Field;}class Program{ static void Main(string[] args) { Generic<String> g = new Generic<String>(); g.Field = "Hi"; Console.WriteLine(g.Field); }}
a) Compile time error
b) Generic being a keyword cannot be used as a class name
c) Runtime error
d) Code runs successfully