cklangford98 cklangford98
  • 02-03-2018
  • Computers and Technology
contestada

Given the code below, what would output to the Console Window?

Think carefully on this one...it is tricky!
C#
1
string a = ”10”;
2
string b = “20”;
3
Console.WriteLine(a+b+5);

Respuesta :

spikespaz
spikespaz spikespaz
  • 03-03-2018
I don't know C# but based on experiences in other OOP languages and languages in general, you get a type error, whatever format that may be for C#. You cannot concatenate "10" and "20" as strings and then attempt to add an integer 5 unless the language has inferred type coercion.
Answer Link

Otras preguntas

Wegeners hypothesis of continental drift was replaced in 1967 by which theory that supported his idea that continents move?
How did Chinese isolation affect trade for China and for the world?
A cell that neither gains nor loses water when it is immersed in a solution must be
One result in the u.s. of the sarbanes-oxley act is that
Joseph bought some t-shirts and a pair of trousers. He bought 4 t-shirts that each cost the same amount of money and the cost of a pair of trousers is $17. Jose
09) Na mandioca existem dois pares de genes situados em dois pares de cromossomos diferentes, que atuam respectivamente sobre a cor da raiz e a largura dos folí
Is weekly religious service rite of passage?
The democratic republican party was based on the idea that the central government of a country should be what?
What are the odds of rolling a sum of 10 using two number cubes?
How to cite something with multiple authors mla?