Goto statement and schema implementation of GOTO mechanism

Source: Internet
Author: User

The Goto statement provides an arbitrary jump inside the method, which is applied in a special scenario.

And assuming that an object executes a method, we expect that any other object can capture it, and then perform some operations on its own, so what can be done?

Classvoid  notices the world ()  {/ ///to map the contents of the notice to the sky, And the sky is the common area between heaven and earth, all objects between heaven and earth can access its      sky. Draw  (); //  the      sky. Shout ();      }} class Grass min {   //this   . Monitor Sky Sound ()}

This pattern is actually in the design pattern, has already had the complaint, the grass and the palace has no relation, but their execution may be at the same time, this is similar to a goto mechanism.

Goto Statement and schema implementation of GOTO mechanism

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.