Without running the code answer the question.
What will be the output of the following?
Console.WriteLine( ‘\t’ + ‘\t’ + “Is this double, single or no indented text?” );
will this actually throw an exception? My first thought is that '\t' is a string escape sequence, but it's noted as though it should be a character (with the single quotes).
ok, i'm going to go run it now hehe
Hint: Think in terms of Expression Evaluation!
Thanks.
---Tanzim SaqibSoftware Consultant & BSc StudentCell: 88 0189 194 193
With my experience with C# and programming in general, I have found that the single quotes will cause the \t to be interpreted as a character literal, but as with most C# variables, it would have to be converted to the string datatype. In every program I have written, everything has to be explicitly casted so I think that this line of code will give a compile error. If it is not caused by the attempted implicit cast, it will be caused by the fact that two variables of type char cannot be added using the + operator unless the operator was specifically overloaded to allow the two \t to be concatinated into a character array or if the ToString function is called for both \t (this would require more than one line of code). This would cause a WL( char [] + string) that would still need to be implicitly casted and concatinated. Conclusion: compile time error
With out running a program there is no output.
So answer is no output.
Any further doubt you first run the code and then find the answer.
Thankyou,
Poornendulal.V
hello ano po name mo me kenneth thanks