+ 1

Could you use this in WPF?

My school uses WPF instead of console, could I still use the var keyword there and how?

8th Mar 2017, 9:03 AM
Redsage Horrorwitz
Redsage Horrorwitz - avatar
2 odpowiedzi
+ 2
okay! Thanks for the help: D
8th Mar 2017, 1:11 PM
Redsage Horrorwitz
Redsage Horrorwitz - avatar
0
U can use the var keyword if you dont want to tell the kind of specific datatype. Let says i have list<string> studentList = new list<string>(); studentList.Add("david"); studentList.Add("samuel"); Now let print the name of all students. we can use foreach(string stList in studentList) { MessageBox.Show(stList); } Or U can use the var here foreach(var stList in studentList) { MessageBox.Show(stList); } And it will work as if u specify string
10th Mar 2017, 1:23 AM
Atakorah Kofi
Atakorah Kofi - avatar