Differences between C # And C # and Java

Source: Internet
Author: User
IC #AndC

1 c #Usually no pointer is used

2Variables can be declared anywhere in a method without having to place the declaration statement at the top of the method.

3You do not have to declare an object before using it. You can define it when using it.

4 C #The definition of the structure type is somewhat different. It does not support the Union type at all.

5 C #There is an enumeration type. A series of named values (such as color and week) can be assigned continuous values, but the syntax is somewhat different.

6 c #No bit field. That is to say, a variable occupies at least one byte of storage space.

7 C #Variable-length parameter lists are not supported. You must define a method for parameter values and types.CThe statement allows the last parameter of the function to be a variable parameter array.

8 C #Introduced the idea of proxy and indexer, which are not available in other popular languages.

IIC #AndJava

1Many System Objects have the same method name, but the case format is different.

2 C #Not availableThrowsKeyword. This keyword enables the compiler to check whether you have caught an exception thrown by a method.

3 C #There are more restrictions on the layout manager because it usesWindowsSystem-centered, most of which take the absolute position of the Graphic Element

4 C #Allowed Operator Overloading

5 C #Introduced proxies and indexers

6 c #Enumeration type

7 C #Insecure mode. You can use pointers in this mode.

8You must specifically declare that one method can overwrite and one method can overwrite another method.

9Declarations cannot be used to differentiate and implement inherited interfaces. Their declaration methods are the same.

10 SwitchThe statement allows the use of character variables. If the variables are not matched, there must be a default condition. Otherwise, an error occurs,BreakThe statement is required.

11Boolean variable type inC #ModerateBool,JavaModerateBoolean

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.