O'Reilly logo

Professional C# 6 and .NET Core 1.0 by Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2 Core C#

What’s In This Chapter?

  • Creating Hello, World! with Visual Studio
  • Declaring variables
  • Initialization and scope of variables
  • Predefined C# data types
  • Dictating execution flow within a C# program
  • Enumerations
  • Namespaces
  • The Main method
  • Using internal comments and documentation features
  • Preprocessor directives
  • Guidelines and conventions for good programming in C#

Wrox.com Code Downloads for This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalcsharp6 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • HelloWorldApp
  • VariablesSample
  • VariableScopeSample
  • IfStatement
  • ForLoop
  • EnumerationsSample
  • NamespacesSample
  • ArgumentsSample
  • StringSample

Fundamentals of C#

Now that you understand more about what C# can do, you need to know how to use it. This chapter gives you a good start in that direction by providing a basic understanding of the fundamentals of C# programming, which is built on in subsequent chapters. By the end of this chapter, you will know enough C# to write simple programs (though without using inheritance or other object-oriented features, which are covered in later chapters).

Creating Hello, World! with Visual Studio

Chapter 1, “.NET Application Architectures,” explains how to write a “Hello, World!” C# program using the csc Compiler for .NET 4.6 and using dotnet tools for .NET Core 1.0. You can also create it with Visual Studio 2015, which is done in this chapter. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required