Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Source code: m is a text file received by the compilator, converting it into an object program or bytecode. Methodology of programming: is the methodology of the need to solve problems through the use of algorithms. Algorithm: is a method that contains an ordered sequence of steps that lead to the resolution of a specific problem. Developing algorithms helps us to structure problems and visualize more clearly the solution. Parts of the algorithm: Entrance, Process, Exit Java: is a programming language of general purpose that was created by Sun Microsystems with the objective of creating a language that could operate in any platform or operational system. To date Java has released different versions of Java Development Kit like JDK 1.1, JDK 1.2. J2SE (Java 2 Standard Edition): Group is made of packaged of Classes of general use. We can include in this classification those applications that run on the web or on a text processor. J2EE (Java 2 Enterprise Edition): Provides packages and technologies necessary for the creation of multiple business applications, especially for those that run in a web environment, such as an e-commerce application installed in a companys webpage. J2ME (Java 2 Micro Edition): This group includes a series of packages that enable the creation of Java applications on electronic devices such as cell phones, electronic agendas and PDAs. It could be the card game installed on your cell phone.
Next we will define the methods, the actions that you can execute with the object. Opening it, Closing it, Shake it Define objects: e, is a unit code that contains a series of operations that can be used by programs to execute certain tasks. Attributes: characteristics of objects. Methods: The operations that an object can execute Object: in Java language, is a unit code that contains a series of operations that can be used by programs to execute certain tasks. Parameter: The information that requires a method to operate Class: can be defined as a category to group objects that share characteristics and/or similar attributes.
byte -128 to 127 short -32768 to 32767 integer -2147483648 to -2147483647 long 9223372036854775808 to 9223372036854775807 Decimals
float 3.4 x 10-38 to 3.4 x 1038 double 1.7 x 10-308 to 1.7 x 10308 Characters
Logic operators AND: Is represented by the following symbols: &&and returns true only when both conditions are true, else returns false. OR: Is represented by the following symbols: ||and returns false only when both conditions are false, else returns true.
NOT: Is represented by the symbol: ! Affects only one condition and returns true if it has the value of false and vice versa. XOR: Is represented by the symbol: ^ and returns the value true as long as one condition is true and the other is false, else returns false.
{ System.out.println(He is of age); } else { System.out.println(He is underage); } Switch (use): is a statement of multiple alternatives that allows you to perform certain instructions to the result of the expression. Conditional operators: <: If the left operand is less than the right operand, returns true. >: If the left operand is more than the right operand, returns true. !=: Compares two values, in case they are different returns true == : Compares two values, in case they are equal returns true <=: If the left operand is less than or equal to the right operand, returns true. >=: If the left operand is more than or equal to the right operand, returns true.
To call a method, you need to write the name of the variable and the name of the method separated by a point. housejavier.show_info();
Worker method: is an execution method and it executes an action. Call method: is a method that calls another method to execute an action. The call method sends the worker to perform certain actions and waits until the worker finishes its action to proceed with the rest of the program. "Static" modifier: can be called without having to initialize a variable that refers to an object and can also be called by more than one class, meaning, they are not specific to a class in particular. Methods that use the "static" modifier can be accessed by any method from any other class in the program. Method overflow: methods in a class that have the same name but have different arguments.
Bidimensional matrixes are initialized in the same way as unidimensional matrixes with the difference that we add another pair of brackets. Example: int s[ ][ ]; s=new int[10] [15];
3. Repeats the point 1 for the n-2 first elements of the list and so on until you finish with all the elements.
public static void bubble(int [] array){ int aux; int i; int number_of_elements= array.length; boolean s=true; while ((s==true) && (--number_of_elements > 0)){ s=false; for (i=1; i<= number_of_elements; i++){ if (array[i-1]>array[i]){ aux=array[i-1]; array[i-1]=array[i]; array[i]=aux; s=true; } } } }
Insertion method: The first two elements of the array are ordered initially, and then the third element is inserted in the correct position in respect to the previous ones, and so on. This is done until the last element has been inserted.
public static void insertion(int [] matriz){ int array[40]; double x; int i, k; int number_of_elements= array.length; for (i=1; i<number_of_elements; i++){ x=array[i]; k=i-1; while (k>=0 && x< array[k]){ array[k+1]= array[k]; k=k-1; } m[k+1]=x; } }