C # Third Job (class essays)

Source: Internet
Author: User

Simply try to use the class, obviously output stub for displaycurrenttime.

The line that is commented is to try to read in the black box and output: But obviously two are not parallel. Run immediately to be ejected and error. How do I read directly in the Run box?

string S;
s = Console.ReadLine ();
Console.WriteLine (s);
Console.readkey (); By doing so, ReadLine will read the variable s directly on the next line, that is, the next line will read only one variable, not a space separated by a continuous read-in.

Note the third line of the main function

At this point the result is

Switch

The result changes

parameter name: The value of this form tells the compiler which argument the statement jumps to, and can be assigned, and not limited to jumping parameters

When you apply the sealed modifier to a class , this modifier prevents other classes from inheriting from the class, but you can use this class to inherit other classes

Class N {}

Sealed class M:n {}

M inherits N, but m cannot be inherited by another class.

Override is not implemented for the time being. To be modified.

Ask how to read multiple variables directly on the same line, that is, a space-delimited read-in.

C # Third Job (class essays)

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.