Linear (or Procedural) Programming is marked by sequential processing: statement
ID: 3664197 • Letter: L
Question
Linear (or Procedural) Programming is marked by sequential processing: statements are executed in a sequential order, one after the next, in an orderly, linear fashion. The only exception is when there's a call to a function/module; execution momentarily moves to the module and then returns back to the calling point after all statements in the called module complete. Processing then resumes in sequential order again.
If event-driven programming depends on user/program/OS interaction and actions to trigger the events, how does an event-driven Java program even start??? And, once started, how does it continue and when does it end???
Explanation / Answer
First of all let me say, Java is an object oriented programming and within that environment Java has the capability of event-driven feature, which implies Java programs control will be decided by any other external inputs like user input/ other programs/ or system inputs,etc..
One of the commonly used technique for achieving event-driven capability is by using 'Messaging technique' in which the program receives messages from external sources and according to the message inuput the Java program decides where to go and what to do. For this, the java program will be listening for any external message parallely and if recieves one then act accordingly.Thus, this event drivent is just only a feature in Java. The user only needs to write code to start program and when the user excutes the code or by using any previously configured automatic scripts, the Java program will start. After starting the program decides what to do and how to continue according to the code, eventhough if there is no events from external source, likewise after finishing the code execution the program itself will be terminated. This is how a Java works.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.