![]() The path of execution refers to the sequence of instructions that gets executed.Īs we'll see, this can be single statements that do something small, or it can ask another behavior to do its thing (asking another behavior to initiate is called invoking it).Įxample: invoking a method is like the cashier asking the dough-chef to prep the dough for a large pie!Īs in the pizzeria sketch above, we only execute a behavior if we ask it to run. what would the inputs and outputs be for each behavior!?.how would you describe it in terms of a few behaviors?. ![]() Choose one of the following every-day services and imagine it is a Java class (no need for actual code, just high-level discussion). We'll talk about that at a later time.Īctivity 1: You'll be assigned to a Breakout group. There is a way of using a class without executing it directly. Note that this is the case when you want to execute the class. ![]() The main rule: There needs to be one method called main where execution may start. In Java, that would be the main method, and it represents the initial point of execution. If this were a Java program, the class would represent the pizzeria, and each one of the behaviors would be a different method.Ĭrucially, there is an initial point of entry(the cashier) to call other behaviors. In this analogy, we have one pizzeria with four behaviors: The expected outputs are the actual pie and a receipt. In this example, the input to the store is the sentence: " one large pepperoni pizza", and your credit card info.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |