Re[3]: Имя класса совпадает с полем - почему нельзя?
От: Сэма Россия  
Дата: 10.09.12 12:51
Оценка:
Здравствуйте, matumba, Вы писали:

M>"Такова жизнь!" — ответ примерно такого уровня. Мой вопрос: ПОЧЕМУ нельзя иметь одинаковые имена.

На самом деле это был правильный ответ.

Курим спецификацию, раз компилятор нам не указ
Each class, struct, or interface declaration creates a new declaration space. Names are introduced into this declaration space through class-member-declarations, struct-member-declarations, interface-member-declarations, or type-parameters. Except for overloaded instance constructor declarations and static constructor declarations, a class or struct cannot contain a member declaration with the same name as the class or struct.
Место для курения
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.