GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#
Go To First  |  Previous Question  |  Next Question 
 C#  |  Question 191 of 431    Print  
Structs and classes support inheritance
Skill/Topic: Intermediate
A) True
B) False
Explanation: Only classes can inherit. Structs can’t.



  
Total Answers and Comments: 2 Last Update: February 09, 2006   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Emma
 
structs can inherit interfaces

Above answer was rated as good by the following members:
albanaco
December 10, 2005 10:05:36   #1  
sahu Member Since: December 2005   Contribution: 324    

RE: Structs and classes support inheritance

ans:

B) False

 only class support inheritance,but not structs


 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
February 09, 2006 06:23:36   #2  
Emma Member Since: February 2006   Contribution: 3    

RE: Structs and classes support inheritance
structs can inherit interfaces
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

C# does not support an explicit fall through for case blocks. The following code is not legal and will not compile in C#: switch(x){case 0:// do somethingcase 1:// do something in common with 0default:// 
Latest Answer : c# switch allows fall through if and only if in empty case. as long as there is a statement in the case it must  use break or go to to  jump out of the case. ...

No. C# does not have macros. Keep in mind that what some of the predefined C macros (for example, __LINE__ and __FILE__) give you can also be found in .NET classes like System.Diagnostics (for example, 
Latest Answer : Ans:No ...

No. However, there are plans for C# to support a type of template known as a generic. These generic types have similar syntax but are instantiated at run time as opposed to compile time. You can read more 
Latest Answer : Generics are a new feature in version 2.0 of the C# language and the common language runtime (CLR). Generics introduce to the .NET Framework the concept of type parameters, which make it possible to design classes and methods that defer the specification ...

Yes. Here's a simple example: using System;class Class1 {private string[] MyField;public string[] MyProperty {get { return MyField; }set { MyField = value; }}}class MainClass{public static int Main(string[] 
Latest Answer : yes u can use indexer.its working is same as properties. ...

From language spec:The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes 
Latest Answer : Following are the main points of difference between classes and structs in C#:Value type vs Reference type: Structs are value type and classes are reference type. Whenever a struct object is assigned to another struct object a copy is created. In case ...

Casting the char to an int will give you the ASCII value: char c = 'f';System.Console.WriteLine((int)c);or for a character in a string: System.Console.WriteLine((int)s[3]);The base class libraries 
Latest Answer : Ans:// Create an ASCII encoding.            Encoding ascii = Encoding.ASCII;The base class libraries also offer ways to do this with the Convert class or Encoding classes if you need a particular ...

From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class?
With regard to versioning, interfaces are less flexible than classes. With a class, you can ship version 1 and then, in version 2, decide to add another method. As long as the method is not abstract (i.e., 

Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
There is no way to restrict to a namespace. Namespaces are never units of protection. But if you're using assemblies, you can use the 'internal' access modifier to restrict access to only 

Yes. Try-catch-finally blocks are supported by the C# compiler. Here's an example of a try-catch-finally block: using System;public class TryTest{static void Main(){try{Console.WriteLine("In 
Latest Answer : Ans:yes ...

By using the Registry and RegistryKey classes in Microsoft.Win32, you can easily access the registry. The following is a sample that reads a key and displays its value: using System;using Microsoft.Win32;class 
Latest Answer : Ans:By using the Registry and RegistryKey classes in Microsoft.Win32 ...


 Sponsored Links

 
Related Articles

ODP.NET - Fundamental ODP.NET Classes to Retrieve Data

ODP NET Fundamental ODP NET Classes to Retrieve Data To retrieve data from an Oracle database using ODP NET we need to work with a few of the ODP NET classes At this point we will discuss the most fundamental classes available in ODP NET for retrieving data mosgoogle The following is the list of fun
 

Microsoft AJAX Library - Inheritance using Prototypes

Inheritance using Prototypes Once again prototyping can help us implement an OOP feature in a more elegant way than when using closures Prototype based inheritance makes use of the behavior of JavaScript prototypes When accessing a member of a function that member will be looked for in the function
 

Microsoft AJAX Library - Inheritance using Closures

Inheritance using Closures and Prototypes There are two significant techniques for implementing the OOP concept of inheritance with JavaScript code The first technique uses closures and the other technique makes use of a feature of the language named prototyping Early implementations of the Microsof
 

Microsoft AJAX Library - C# and JavaScript Classes

C and JavaScript Classes For the purpose of demonstrating a few more OOP related concepts we ll use another class Our new class is named Table and it has two public fields rows columns and one method getCellCount The getCellCount method should return the number of rows multiplied by the number of co
 

Microsoft AJAX Library - JavaScript Classes

JavaScript Classes Not only can JavaScript functions contain other functions but they can also be instantiated This makes JavaScript functions a good candidate for implementing the concept of a class from traditional object oriented programming This is very helpful feature indeed because JavaScript
 

ERP Systems as Quality Control Support

ERP Systems as Quality Control Support For the past few years ERP systems have became one of the most powerful tools for quality control management But ERP is just an informatics system that provides support to the integrated business management mosgoogle center Goals of the Quality Control Module i
 

C++ Storage Classes

C Storage Classes In this C tutorial you will learn about storage classes types of storage class variables Automatic External and Static explained with examples mosgoogle center Storage classes In the context of scope of variables in functions exists the important concept of storage class What is St
 

C++ Inheritance

C Inheritance Introduction What is Inheritance Inheritance is the process by which new classes called derived classes are created from existing classes called base classes The derived classes have all the features of the base class and the programmer can choose to add new features specific to the ne
 

C++ Objects and Classes

C Objects and Classes An Overview about Objects and Classes In object oriented programming language C the data and functions procedures to manipulate the data are bundled together as a self contained unit called an object A class is an extended concept similar to that of structure in C programming l
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape