value class convention
sproket at videotron.ca
Mon Dec 22 20:00:12 UTC 2014
Question what does the following C# code output:
static void Main(string args)
Account account =new Account();
account.Balance = 10;
Console.WriteLine("BEFORE: " + account);
Console.WriteLine("AFTER: " + account);
static void adjustAccountBalance(Account account,float balance)
account.Balance += balance;
Answer: *unknown.* Since we don't know if an Account is a *class *or a
One way would could help avoid this situation in Java would be to use
lower case/underscore convention for value types - to give same
indication as primitives.
Here we'd have:
account account =new account();
point p =new point();
What do you think?
This email has been checked for viruses by Avast antivirus software.
More information about the valhalla-dev