C Sharp

C Sharp is a programming language developed by Microsoft Corporation. It is designed to be a simple, general-purpose, modern, object-oriented programming language. The latest version is C# 4.0. It is designed for developing applications for both embedded and hosted systems.

1,124 Questions
Java Programming
C Sharp

Which language is easy to learn java and c sharp?

C# and Java have many similaries. If you learn one, you won't have much of a problem learning the other.

287288289
C Programming
C Sharp

How do you flow chart in C programming?

A flow chart is an aid to getting the logic in a program doing the wright things. A flow chart is useful with any programming language.

249250251
Java Programming
C Sharp

Is MSIL similar to java byte code?

Yes, in some way it's similar.

One difference is that Java Bytecode is typically interpreted by the virtual machine, while MSIL is JIT-compiled to native machine code before executing. However, it is increasingly common for bytecode to be compiled as well.

243244245
C Sharp

What is overloading in c sharp?

My answer may not be the intent of the designer of overloading. But here are my understanding and the best use of it:

If you have a group of methods that are:

1. functioning the same (return the same object type), and

2. they takes different parameters or arugments,

you may overload that that group of methods with the same name.

Please note that the word may. (You have the option, but do not have to)

One example is the overloaded method ToString()

Some of other possible overloading ways are: ToString(string fmt), ToString(int start, int count);

In other computer language, one may have to code as ToFormattedString(), ToSubString(), instead of using the same method name.

227228229
VBNET
C Sharp

Is System.String a class or a struct?

System.String is a class. However, it is somewhat unique in that it is immutable, meaning that it is readonly. So if you change the contents of a string, behind the scenes it creates a new string object and destroys the old one.

171172173
C Sharp

What are indexers in c sharp?

An indexer is a special kind of Property at instance level.

For example:

public class MyBook {

public string this[string stringIndex]

{ get { return null; } set { // }}

public string this[int intIndex] {

{ get { return null; } set { // }}

}

}

MyBook has two indexers, one in the form of string, one in the form of int.

Example continue:

MyBook aBook = new MyBook();

Console.WriteLine(aBook["Whatever"], aBook[100]);

159160161
C Sharp

Is it possible to override the Main method in C?

Perhaps this question is misplaced: the category is for C#, while the question is for C language.

The short answer for either language is NO. Main() is not overridable, and it must be implemented to start with.

For C# (I assume it was a typo in the question), the question is why one wants to override a method. Notice that Main() is a static method, and any static method in C# cannot be overridden. In fact, any static member (of a class) cannot be overridden.

The responsibility what Main should do is to serve as the entry point of the program. Although one may argue that it also serves the exiting point of the program, this is not the point. I strongly recommend only writing codes in Main() for:

  • Any initialization to the application (or delegate to other objects),
  • Any tear down to the application (or delegate to other objects),
  • Delegate the core application logic to another method
  • Validating the commandline arguments (or delegate to other objects)

Because the above are SPECIALIZED for a particular application, there is nothing to be inherited from, and thus nothing to override (from inheritance)

147148149
Electrical Engineering
Wireless Networking and WiFi
Laptops
C Sharp

Why my Wireless connection is not working on my laptop?

Wireless problemsI have a similar problem with my laptop. I have a Fujitsu-Siemens Lifebook, one that has been great over the past year for college, etc. However, my wireless internet connection suddenly went off the other day with no warning, with the modem showing that there was no local network and the laptop showing no available connection.

First thing to do - check wireless is turned on. It sounds basic, but sometimes the switch can get knocked, meaning that the laptop won't recieve any wireless signal. If this doesn't work, play around with the settings for a while - if you're running Windows you can go to 'network connection' in Control Panel and right-click on your wireless connection; go to 'repair' and the repair wizard will go through it to try and fix it. Make sure both the wireless switch on your laptop is turned on, and that your modem is turned on too.

If this doesn't work, go to your modem's setup page (usually a web page - the address will be in the manual) and choose a different wireless channel - 0, 6 and 11 are the only non-overlapping channels. You may want to adjust your wireless signal power to make sure you have enough signal. You might also want to run a diagnostic on your modem to see if it is running properly. Some modems will display on the setup page which computers are active. See if yours comes up.

If this still doesn't work, you may want to go to an internet cafe or other wireless hotspot to check whether it is your modem which is at fault. If you get a signal and can connect, then it may well be the modem at fault. Check at some other locations just to be sure. If not, it sounds like the wireless card has a problem. If it is an internal wireless card, you might want to take it back to the manufacturer for repair. If it is an external wireless adapter, you may just want to replace the card or adapter to see if this helps.

434445
C Programming
C Sharp
C++ Programming

What is a static identifier in C?

In C, a variable declared as static in a function is initialised once, and retains its value between function calls.

The default initial value of an uninitialized static variable is zero.

If a function or global variable is declared static, it can only be accessed in that file.

115116117
C Sharp

How user defined exceptions in c sharp works?

It works the same way as the ones in System.Exception:

To make an exception happen, use the keyword throw, followed by an instance of an Exception (or an object from a derived Exception. A user defined exceptions of course is a derived exception)

Exception anException = new WowException(); //or new Exception("Wow");

throw anException;

The catcher can specifically catch the exception being thrown, or generally as catch-all:

try {

MakeMyDay();

} catch (MyOMyException e) {//do something about e}

catch (Exception e) { //do something about e}

void MakeMyDay() {

//some code, and encounter some special cases

throw new MyOMyException();

}

public class MyOMyException : SystemException //I prefer SystemException. ApplicationException will do as well, but not Exception

{ public MyOMyException() : base("My-Oh-My, what you've done?!"){}}

113114115
Java Programming
C Sharp

How do you implement run time and compile time polymorphism?

Run time polymorphism maybe achieved by implementing a particular interface among different class hierarchies, or using the same delegate from different objects. (delegate maybe thought as an interface to invoke methods with different names but with the same parameters. These methods may or may not be of the same object/class)

Compile time polymorphism is achieved by classinheritance or implementing an interface.

Run time way means the actual implementing class is UNKNOWN (uncertain) at compile time, and maybe injected into your application in real time (through reflection is one way to get dynamic classes). Yet because the runtime object implements the predefined interface (at compile time), the "polymorphism" is achieved.

109110111
VBNET
C Sharp

Difference between vb net and c sharp?

Both languages use the same .NET Framework, so the functionality available to you is very similar. They are both OOP languages.

The differences are mostly syntactical. VB tends to be more verbose than C#.

In fact, 3rd party programs exist that will convert C# code to VB.NET or vice-versa. So the choice of which to use is personal preference.

107108109
Jobs & Education
VBNET
C Sharp

What did the delegates do to solve the problem of how many representatives each state can have?

This issue all goes back to the Constitutional Convention, when there was an issue of big states vs. small states. After a heated debate, the Great Compromise was proposed by Roger Sherman, which created a bicameral legislature. Each states would have equal representation in the Senate (satisfied the small states) and the size of the population of each state would determine the state's representation in the House of Representatives (satisfied the big states). There is also a similar case in the state of Alabama in which the state legislature were apportioned and assigned to districts, based on populations. This supreme court case is known as Reynolds v. Sims.

919293
Computer Programming
Java Programming
C Sharp

What is the function of catch Exception E?

In Java, if there is a run-time error then it allows the user to explicitly handle it by catching it in the catch block. If there is any error in the try block of code, automatically the flow control will be transferred to the catch block. Here Exception e indicates any exception. The same is true in both Visual Basic and C#. This is seen in the

try {}

catch (Exception e) {}

blocks. Which then function as the previous poster said.

== == == ==

929394
Computer Programming
Musical Instruments
C Sharp
Scales and Key Signatures

How do you mute sound with c sharp?

http://www.geekpedia.com/tutorial176_Get-and-set-the-wave-sound-volume.html

this site explains it well

858687
Computer Programming
C Sharp

Is c sharp a case sensitive language?

Yes, it is.

848586
C Programming
.NET Programming
C Sharp

When was the programming language C Sharp initially developed or released?

It was developed by Microsoft during 2000-01. A beta version was released in October 2001 and a full version was out in April 2002.

During the development of the .NET Framework, the class libraries were originally written using a managed code compiler system called Simple Managed C (SMC). In January 1999, Anders Hejlsberg formed a team to build a new language at the time called Cool, which stood for "C-like Object Oriented Language". Microsoft had considered keeping the name "Cool" as the final name of the language, but chose not to do so for trademark reasons. By the time the .NET project was publicly announced at the July 2000 Professional Developers Conference, the language had been renamed C#, and the class libraries and ASP.NET runtime had been ported to C#.

C# First Language specification was given on December 2001

and its First Version was released on January 2002

818283
Definitions
VBNET
C Sharp

Full form of net?

What is .net fullform?

Ans- network enabled technologies

474849
C Programming
C Sharp

What is faster access the element in an array or a variable?

Arrays are variables, too.

Accessing array-elements is obviously a bit slower than accessing scalars.

757677
Java Programming
VBNET
C Sharp

What is the difference between actual and formal parameters?

Formal parameters are the parameters as they are known in the function definition. Actual parameters (also known as arguments) are what are passed by the caller. For example, in the following code, a and b are the formal parameters, and x and y are the actual parameters:

int max(int a, int b) {
if (a > b) return a;
else return b;
}

int m = max(x, y);

333435
Java Programming
C Programming
C Sharp

Write a program to count the number of vowels and consonants in a given string?

//testing code

//note that a space character should be neither a vowel, nor a consonant

string s = "This is a test";

Console.WriteLine("Source string: {0}", s);

Console.WriteLine("# of Vowels: {0}",

GetCount(s, "aeiou"));

Console.WriteLine("# of Consonants: {0}",

GetCount(s, "bcdfghjklmnpqrstvwxyz"));

// helpers

// get number of characters in source that are in charactersToMatch

public int GetCount(string source, string charactersToMatch)

{

char[] target = charactersToMatch.ToCharArray();

int count = 0;

foreach (char c in source.ToLower()) {

if (IsMatch(c, target)) count++;

}

return count;

}

//returns true if c is one of patterns, false otherwise

public bool IsMatch(char c, char[] patterns)

{

foreach (char p in patterns) {

if (c == p) return true;

}

return false;

}

727374
Computer Programming
Java Programming
C Sharp

Why should main be declared static and is declaring it public and void not sufficient?

The static modifier means that it does not have to be instantiated to use it. Before a program runs there are technically no objects created yet, so the main method, which is the entry point for the application must be labeled static to tell the JVM that the method can be used without having first to create an instance of that class. Otherwise, it is the "Which came first, the chicken or the egg?" phenomenon. Your main method should be declared as follows: public static void main (String[] args) { lots of your java code... } As we know, java is a pure OOP , that means everything should be in the class, main. Aso, because main is itself a function, static member functions should not refer to objects of that class. But we can access static functions through classname itself, as: class TestMain { public static void main(String args[]) { body; } } Now, cmd>javac TestMain.java cmd>java TestMain as we know the static member functions has to call through its class name. That's why the programme name must be same as the class name ,where we wrote the main function. Another important point is : static variables or member functions will load during class. That means before creating any instances(objects), the main function is the first runnable function of any program which we run manually, such as : cmd>java TestMain(run) if , any sharing information.

666768
Phobias
C Sharp
MySQL

What triggers xanthophobia?

The best way to have your carpets cleaned would be to hire a professional. These companies have the proper tools to make sure there isn't any damaged caused.

515253
C Sharp
The Difference Between

Differences between windows application and a console application in c sharp?

A console application will use the console to interact with the user. A window application will use a graphical interface to do so.

697071
C Programming
C Sharp
C++ Programming

What is the meaning of near and far declaration in microprocessor programming using C?

Programs that are loaded into memory typically have several segments associated with them: the Code Segment (CS), the Stack Segment (SS), the Data Segment (DS), sometimes an Extended Segment (ES), and almost always a Block Started by Symbol (BSS) segment. This question requires that we focus only on the Code Segment (CS). The CS is a segment of memory that contains some of the instructions that are required for the program to execute. If this segment is not large enough to contain the whole program then the program can be loaded into different segments. Such a segment may be 64Kb in size (although the size may differ). Instructions located in these segments are referred to by their offset from the start of the segment, and not by their absolute location in memory. Thus, in order to locate a certain instruction, we need the segment's starting address, and the offset of the instruction in that segment. Whenever a branch (jump, goto) takes place which refers to an instruction that is located in another segment, it is known as a far jump, conversely whenever a jump refers to an instruction that is located in the same segment, it is known as a near jump. The difference referring to the modication of the CS register which contains the address of the current Code Segment for the current running program.

697071

Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.