App development tools for Android mobile phones include the Java programming language. Java programs are comprised of classes. Classes include methods that perform tasks and return information. The java compiler translates the Java code statements into bytecodes. Bytecodes are instructions that the Java interpreter recognizes.
Java is an object-oriented language. Examples of objects include people, plants, planes, buildings, cars, computers and mobile phones. Java programmers define the data type of a data structure and the types of functions or operations. The data structure becomes an object that includes both data and functions.
A single if selection statement is a structure that lays out different actions for the program to follow. Another app development tool is the while repetition statement or a looping structure. This statement directs the program to repeat an action while a specified condition remains true. Other control structures include counter-controlled repetition, for repetition statement, the do…while repetition statement, the switch multiple-selection statement and the break and continue statements.
Key concepts and terminology of object orientation includes classes to encapsulate (wrap together) data (attributes) and methods (behaviors). Encapsulation enables objects to hide their implementation from other objects. Objects hid implementation details. Each class contains a set of fields (variables) and methods that manipulate those fields.
In Java, inheritance is a form of software reuse. The data (attributes) and methods (behaviors) of existing classes create new classes. New or modified capabilities enhance the newly created classes. Software reusability helps programmers save time. The programmer designates that the new class inherit the members from an existing class.
The superclass is the existing class. The subclass becomes the new class. Once created, each subclass can become the superclass. This superclass creates future subclasses. Since a subclass adds its own variables and methods, this subclass is more specific than its superclass. The subclass exhibits the behaviors of its superclass. The newly created subclass also exhibits its own behaviors.
Data structures are also important app development tools. Java can handle a variety of data structures. Arrays are data structures consisting of related data items of the same type. An array is a group of variables (called elements or components) containing values that all have the same type. One-dimensional and multidimensional arrays are fixed-sized data structures.
Dynamic structures that change over time include linked lists, stacks, queues and trees. Dynamic memory allocation creates and maintains dynamic data structures. A linked list is a sequence of self-referential-class objects called nodes. The reference links connect the linear nodes. Stacks and queues are constrained versions of linked lists that are also linear data structures. Trees are nonlinear data structures.
A stack is referred to as a last-in, first-out (LIFO) data structure because nodes can be only be added to a stack and removed from a stack at the top. Queue nodes are removed only from the head or front of the queue. These nodes are inserted only at the tail or end of the queue. A queue is a first-in, first-out (FIFO) data structure. A queue is similar to a checkout line at a store.
Tree nodes contain two or more links. The root node is the first node in a tree. Each link in the root node references a child. The left child is the first node in the left subtree. The right child is the first node in the right subtree. The children of a specific node are siblings. A leaf node is a node with no children.
More information about Java may be found here.