juststeve
asked on
Passing and using a param
Starting a transition from VB to C# and am confused by a code sample below - specifically the line:
DateTime dateTime = (DateTime)obj;
When I use a C# to VB translator that line becomes:
Dim dateTime As DateTime = CType(obj, DateTime)
which i get. Still...seems very strange to see the parens _leading an object. Perhaps a couple words of explaination would get my head the rest of the way around what's going on there.
DateTime dateTime = (DateTime)obj;
When I use a C# to VB translator that line becomes:
Dim dateTime As DateTime = CType(obj, DateTime)
which i get. Still...seems very strange to see the parens _leading an object. Perhaps a couple words of explaination would get my head the rest of the way around what's going on there.
class DateTimeRenderer : IObjectRenderer
{
public void RenderObject(object obj, System.IO.TextWriter writer) {
DateTime dateTime = (DateTime)obj;
writer.Write(dateTime.ToString("yyyy/MM/dd HH:mm:ss.fff"));
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, glad to help. ;=)
ASKER