A complete application is a program that a person can command to run after he or she writes it or downloads it into a computer. Commanding to run a program is variously called "running", "executing", "launching", and "opening an application". It means that somehow the program code is readied inside the computer so that code begins to control what the computer does.
Usually, what the computer does when controlled by a complete application is useful. However, a program is still considered a complete application when what it makes the computer do is nonsensical, is merely amusing, or is only a partial or incorrect version of what the programmer or the person running the application desires. Often people are told that computers do what they are programmed to do, not what we want them to do. That is hard to believe because most people see computers doing what people want most of the time. Also, most people cannot clearly account for why or how computers fail or behave unexpectedly. However, a computing professional or serious hobbyist or student takes very seriously the maxim that computers do only what they are programmed to do.
It is absolutely critical to realize that what an application makes the computer do is determined by and only by the program code1 plus the interactions or data input that the application encounters when it is run. The desires, wishes, intentions, goals, dreams, nightmares, or anything else the programmer's or the person choosing the application thinks about in no way determine what the computer does!
Example:
Consider this program:
class AddTwoPlusThree
{
public static void main(String[] aasasdf)
{
int answer;
answer = 2 + 3;
System.out.println("Two plus three equals " + answer);
}
}
Question: When this application is run, it prints "Two plus three equals 5". Why?
Computer science graduates are expected to be able to transform a concept or a description of what a complete application is supposed to do when it runs into the actual code of an application that does it acceptably.
Question: Mustn't the argument list of main be (String[] args)? That's the way it's written in every textbook and program I've seen.
The following step-by-step account of facts answers the question:
The idea that rules apply independently of the context of their use is a kind of "context-freeness".
Question: So why does everybody spell the argument to their programs main function "args"?
(answer and example)
Question: So why can't we use a method name like "startHere" instead of "main"?
We answer by asking another question.
Question like a computer scientist would ask: A method is called by code with the method's name written in another method (or the same method, if it is recursive). So how can the first method call be made?
Answer: The Java virtual machine treats the first method call as a special case. Otherwise, the answer would be "It can't, so the Java system is useless." (maybe elaborate after reseaching Java documentation).
The analogous problem arises in every programming system. At the operating system's executable file loading level, every executable file has data in it at a specific place that determines the address of the first instruction to be executed after the program is loaded into memory. At the elementary C or C++ programming level, the function named "main" is called shortly after execution begins.
There is a difference for interpreted languages such as Python, Perl, or Scheme. The interpreter reads the source file each time the program is run and it executes the statements in the order they are read. Some statements operate to define methods (also called functions) or declare variables, and others command the interpreter to do an executable operation (write better or simplify? or omit this point?)
There has been error in communication with booki server. Not sure right now where is the problem.
You should refresh this page.