Download presentation
Presentation is loading. Please wait.
1
C# Language & .NET Platform 3rd Lecture
Pavel Ježek Some of the slides are based on University of Linz .NET presentations. © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License (
2
C# vs .NET vs CLR C# .NET CLR CLR change 1.0 1.1 2.0 generics
3.0 (WPF, …) 3.0 3.5 (LINQ, …) (dynamic) 4.0 4.0 (Tasks) 4.0( ) (async/await) 5.0 4.5 4.0( ) better GC 6.0 4.6 4.0( ?) RyuJIT 7.0 4.7 4.0 .NET Core Runtime change 2.1 Span<T> support
3
Putting C# into Perspective
Java Powerful (e.g. multiple inheritance) Productive (e.g. lot of syntactic sugar) Simple Fast Safe + Less errors in team development, etc. (many features different from Java) Safe Not slow Interoperable (Source portable) (Binary portable) Binary portable
4
Implicitly Typed Local Variables
Examples: var i = 5; var s = "Hello"; var d = 1.0; var numbers = new int[] {1, 2, 3}; var orders = new Dictionary<int,Order>(); Are equivalent to: int i = 5; string s = "Hello"; double d = 1.0; int[] numbers = new int[] {1, 2, 3}; Dictionary<int,Order> orders = new Dictionary<int,Order>(); Errors: var x; // Error, no initializer to infer type from var y = {1, 2, 3}; // Error, collection initializer not permitted var z = null; // Error, null type not permitted
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.