Click here to Skip to main content
16,014,591 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
IReportDetails reportDetails = null;
if (null == (IReportDetails)Session[StringConstants.reportDetails])
reportDetails = new ReportDetails();
else
reportDetails = (IReportDetails)Session[StringConstants.reportDetails];



In above code what we call to reportDetails in first line(object of interface or instance) and what is (IReportDetails) in second and last line , is it return type of StringConstants.reportDetails, if yes then what it (IReportDetails) will contain ?
Posted

1 solution

Hopefully, that won't compile.
If it does, then someone needs to get smacked.
Classes starting with "I" should be Interfaces - which are never instantiated, and the compiler will not allow it. So the declaration of reportDetails should throw up a compiler error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900