aut1

Embed Size (px)

Citation preview

  • 7/28/2019 aut1

    1/3

    ODAIYAPPA COLLEGE OF ENGINEERING & TECHNOLOGY

    P.T.R PalanivelRajanNagar , Theni-625531.

    DEPARTMENT OF INFORMATION TECHNOLOGY

    Sub.Name: CS1013/C# and .Net ANSWER Total Mark: 50

    Staff.Name: S.Oyyathevan M.E, UNIT-I (2011) Class/Sem:IT/VII

    PART-A (10X2=20)

    1. State 5 important highlights of C# language.1. It is a brand new language derived from the c/c++ family.

    2. It Simplifies and modernizes c++.

    3. It is a concise, lean and modern language.

    4. It is intrinsically objet oriented and web enable.

    5. It is the only language designed for the .NET framework.

    2. How is C# better than java?1. Java uses static final to declare the class constant while C# uses const.

    2.C# supports the struct type and java does not.

    3.C# provides better versioning support then java.

    4.C# includes native supports for properties, java does not.

    5. Arrays are declared differently in C#.

    3. Why C# called TYPE_SAFE language?C# does not permit unsafe cast. C# enforces overflow checking in

    arithmetic operations. C# supports automatic, garbage collection. Reference

    parameters that are passed are type safe. Arrays are initialized to zero.

    Produces error message when the array goes out of bands.

    4. What is Common Language Runtime (CLR)?The Common Language Runtime, popularly known as CLR is the heart

    and soul of the .NET framework. It is a runtime environment in which programs

    written in .NET languages(C#, VB.NET, etc.) are executed. It also supports

    cross language interoperability.

    5. What is managed code?The code that satisfies the CLR at runtime in order to execute is

    referred to as managed code. Compilers that are compatible to the .NET

    platform generate managed code.

  • 7/28/2019 aut1

    2/3

    6. What is the importance of the main method in a C# program?Every C# executable programs must include the MAIN() method in

    one of the classes. This is the starting point for executing the program. A C#

    application can have any number of classes but only one class can have the

    MAIN() method to initiate the execution.

    Example: public static void Main()

    7. Describe the difference between the styles of comments used in C#C# permits two types of commands, namely,

    1. Single- line comments.2. Multiline comments.

    Single-line comments begin with a double backslash(//) symbol

    and terminate at the end of the line.

    Example: // main methods begins

    The multiple comment starts with the /* characters and

    terminates with */

    Example: /*

    This program uses namespaces and comment lines

    */

    8. List the 2 predefined reference type.1. Object type

    2. String type

    9. If a=10, b=15, then the statement x = (a>b)?a: b. what is the value of x?1.Check the conditions x=a>b.2.If the condition is true x is assigned to a=10.3.If the condition is false x is assigned to b.

    a=10, b=15 the condition is false, so x=15.

    10.What is mean by method overloading?C# allows as to create more than one method with the same

    name, but with the different parameter list and different definition. This is

    called method overloading.

  • 7/28/2019 aut1

    3/3

    PART-B (3X10=30)

    11.Explain in detail about the methods and its types with examples.12.Explain in detail about the branching statement with examples.13.Explain the looping statement with examples.14.Explain the .NET architecture and CLR architecture.