您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes
Introduction
Content
Apply
Reflect
Extend
previous.gif
 (3087 bytes)
next.gif
 (2959 bytes)

 
 
Extend Index
Extend Page # 4

Code listings

Listing of UnconditionalBranch.java

class UnconditionalBranch

  {

  void method2()

    {

    System.out.println("statementM1");

    System.out.println("statementM2");

    }

void method1()

   {

  System.out.println("statementA");

  method2();

  System.out.println("statementB");

    }

///// don't worry too much about these next 2 methods

///// just explore how the sending of messages can influence

///// the flow of execution of statements in method1()

UnconditionalBranch()

    {

    method1();

    }

  public static void main( String args[])

    {

  UnconditionalBranch app = new UnconditionalBranch();

    }

  }

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright © 1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg