Quiz Points 1 Rules Raise your hand if

  • Slides: 26
Download presentation
Quiz Points 1 • Rules • Raise your hand if you know the question

Quiz Points 1 • Rules • Raise your hand if you know the question • One student will be picked in random • If the answer is wrong, another student will be given a chance • If answer is given by several students at the same time, no one will get any quiz points!

Q 1 • CLR Manages – (a) memory – (b) garbage collection – (c)

Q 1 • CLR Manages – (a) memory – (b) garbage collection – (c) security – (d) all of the above – (e) only a and b Answer: (d)

Q 2 • Unit of deployment in. NET is – (a) a dll –

Q 2 • Unit of deployment in. NET is – (a) a dll – (b) an executable – (c) an assembly – (d) all of the above Answer: (c)

Q 3 • All. NET languages use a set of types called what? –

Q 3 • All. NET languages use a set of types called what? – (a) CLS – (b) CLR – (c) CTS – (d) Variant Answer: (c)

Q 4 • int in C# is an alias to what in CTS? Answer:

Q 4 • int in C# is an alias to what in CTS? Answer: System. Int 32

Q 5 • What kind of objects are created on the stack? Answer: value

Q 5 • What kind of objects are created on the stack? Answer: value types

Q 6 • What is the process of copying a Value Type to Reference

Q 6 • What is the process of copying a Value Type to Reference type called? Answer: boxing

Q 7 • Generation Count on an object is – (a) the number of

Q 7 • Generation Count on an object is – (a) the number of seconds it has been alive – (b) the number of seconds it will be alive – (c) the number of references on it – (d) the number of times it has seen the GC sweep Answer: (d)

Q 8 • Code executed within the CLR is called what? Answer: managed code

Q 8 • Code executed within the CLR is called what? Answer: managed code

Q 9 • In. NET, certain characteristics like serializable for classes, methods, etc. can

Q 9 • In. NET, certain characteristics like serializable for classes, methods, etc. can be expressed using – (a) comments – (b) xml – (c) attributes – (d) modifiers Answer: (c)

Q 10 • . NET classes generally belong to – (a) Namespaces – (b)

Q 10 • . NET classes generally belong to – (a) Namespaces – (b) packages – (c) project – (d) dll Answer: (a)

Q 11 • C# code is compiled into – (a) assembly – (b) binary

Q 11 • C# code is compiled into – (a) assembly – (b) binary – (c) IL – (d) CLR Answer: (c)

Q 12 • In order to use foreach on a collection, that collection must

Q 12 • In order to use foreach on a collection, that collection must implement what – (a) IEnumerator – (b) IEnumerable – (c) IList – (d) ICloneable Answer: (b)

Q 13 • A using clause is required if you want to use a

Q 13 • A using clause is required if you want to use a class from another namespace – (a) yes – (b) no – (c) may be – (d) not sure Answer: (b)

Q 14 • A property gives you ability to set a field’s value –

Q 14 • A property gives you ability to set a field’s value – (a) without any encapsulation – (b) with full encapsulation – (c) using reflection at run time – (d) none of the above Answer: (b)

Q 15 • Indexers can take as argument – (a) int – (b) double

Q 15 • Indexers can take as argument – (a) int – (b) double – (c) char – (d) all of the above Answer: (d)

Q 16 • What interface each class should implement to properly cleanup its resources

Q 16 • What interface each class should implement to properly cleanup its resources – (a) IEnumerable – (b) ICloneable – (c) IDisposable – (d) IResource. Consumer Answer: (c)

Q 17 • What method of GC should you call to ask it to

Q 17 • What method of GC should you call to ask it to not run the finalize on an object? Answer: Suppress. Finalize

Q 18 • What keyword you would use to check if an object is

Q 18 • What keyword you would use to check if an object is an instance of some type? Answer: is

Q 19 • What keyword is used to make a method overridable – (a)

Q 19 • What keyword is used to make a method overridable – (a) virtual – (b) override – (c) sealed – (d) new Answer: (a)

Q 20 • What keyword is used to write a overriding method – (a)

Q 20 • What keyword is used to write a overriding method – (a) virtual – (b) override – (c) sealed – (d) new Answer: (b)

Q 21 • What keyword is used to make a method nonoverrideable – (a)

Q 21 • What keyword is used to make a method nonoverrideable – (a) virtual – (b) override – (c) sealed – (d) new Answer: (c)

Q 22 • C# allows you to override the following – (a) methods, properties,

Q 22 • C# allows you to override the following – (a) methods, properties, fields – (b) methods and properties – (c) methods only – (d) properties only Answer: (b)

Q 23 • Which of these are statically bound? Calls to – (a) static

Q 23 • Which of these are statically bound? Calls to – (a) static methods – (b) base methods – (c) constructors – (d) non-static methods – (e) sealed methods – (f) methods of a sealed class Answer: all but (d)

Q 24 • An XML element may be of four types as for as

Q 24 • An XML element may be of four types as for as its contents, what are those? Answer: element content, character content, mixed and empty contents

Q 25 • What makes an XML document well formed? 1. 2. 3. Attributes

Q 25 • What makes an XML document well formed? 1. 2. 3. Attributes must have string values Don’t duplicate attributes in an element 4. 5. xml version if present must be 1. 0 xml version if present must be at the very top 6. 7. Element tag names are restricted Proper nesting of elements required 8. 9. Only one root element tag names are case sensitive Special characters may only be used within CDATA sections or as entity references; CDATA can’t have ]] as contents 10. Comments must follow restricted syntax