Third week homework

Source: Internet
Author: User

Title: In the process of doing our team project (game development), we used the C # programming language, and found that it looked very similar to Java, so I wanted to get a closer look at what the similarities and differences between Java and C # really are.

  First attached to the Wiki encyclopedia "http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java" inside the more comprehensive content, although many can not understand, do not understand.

Here are some of my own understanding:

1. a class file in Java can have only one public class, and the class name must be the same as the file name, but there is no such restriction in C #, a file can have more than one public class, and a class can be scattered across multiple files.
Java's class methods generally start with lowercase letters, whereas C # 's class methods generally start with uppercase letters.

2, Java and C # operators are basically the same, but Java more than a bitwise operator >>> Right shift, left empty bits filled with 0

3 , Flow programmed Value Java and C # are basically the same, and the only difference is that they are written in a diachronic way:
java:for (int i:numarray) C #: foreach (int i in Numarray)

4, in the attribute, Java definition and access to use get and set method, you can not appear.
C # is a real property, and when defined, get and set must appear at the same time, accessed with a. Number. No get,set.

5, Java and C # inheritance and interface implementation mechanism is the same, both can only be single-inheritance, the implementation of multiple interfaces.

6. The inner class of Java can access the instance members of the external class directly.
C # is no good. The inner class of C # is equivalent to the static inner class of java.

Third week homework

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.