Proyecto de ingles


Published on

  • Be the first to comment

  • Be the first to like this

Proyecto de ingles

  2. 2. Technical University of Manabi mission:Being academics, scientists and professionals responsible, humanistic, ethicaland caring, committed to the goals of national development, which contribute to solving the countrys problems as university teaching with research, able to generate and apply new knowledge, encouraging the promotion anddissemination of knowledge and culture, under the Constitution of the Republic of Ecuador. vision: Being university, leader and reference of higher education in Ecuador, promoting the creation, development, transmission and dissemination of science, technology and culture, social recognition and regional and global projection. FACULTY OF COMPUTER mission:Being a unit with high academic prestige, efficiency, transparency and quality in education, organized in their activities, protagonists of regional and national progress. vision: Being efficient and innovative professionals in the field of computer science,with honesty, fairness and solidarity, provide answers to the needs of society by raising their standard of living.
  3. 3. TOPICExplanation of the given class in the semester In the field of Programming 2
  4. 4. Introduction to Java 1. History of JAVAIn the late eighties Sun Microsystems decided to enter the market of consumer electronics andmore specifically in home computers, including interactive television. Java, as a language bornin the beginning designed to program appliances!In its early versions, called OAK.2. Design goals of the creators of JAVAFamiliar language:Java language would not be a totally new, it would resemble what we know as C + +, so itwould not be that complicated calling at skeptics programmers.Object-oriented language:To be considered a language object oriented must support at least the characteristics of:- Encapsulation- Inheritance- Polymorphism- Dynamic link.STRONG LANGUAGE:One of the most common programming languages is the ability to write programs that can blockthe system. Sometimes this block can be immediate, but sometimes appear unexpectedlyreached because, for example, the application accesses the memory areas that were not beingoccupied by other programs so far. A clear example is not robust language C. When writingcode in C or C + + programmer should take care of the memory management of an explicitlyrequesting a block allocation and freeing pointers when no longer needed.In Java, pointers, and pointer arithmetic functions and freeing memory allocation (malloc () andfree ()) do not exist. Instead pointers object references are used, which are symbolic identifiers.The Java memory manager takes an accounting of references to objects. When there is nolonger a reference to an object, it becomes a candidate for garbage collection (garbagecollection).LANGUAGE OF HIGH PERFORMANCE (multiple threads):One characteristic of language is that it supports concurrency through threads. Sometimes youmay be interested in splitting an application independent control multiple streams, each of whichperforms its functions concurrently. When different control flows share the same logical addressspace, called threads.PORTABLE LANGUAGE:The main goal of the designers of Java, and given the growth of networks in recent years, wasto develop a language whose applications once compiled could be immediately executable onany machine and any operating system. For example, a program developed in Java on a Sunworkstation that uses the Solaris operating system, should be able to carry a PC runningWindows NT operating system.
  5. 5. LANGUAGE as simple as possible:Java designers tried to keep the basic facilities of the language to a minimum and provide alarge number of extras with class libraries.Safe language:He wanted to build a programming language that is secure, that is, they can not access systemresources in an uncontrolled fashion. For this reason we eliminated the possibility ofmanipulating the memory by using pointers and processing capacity of numbers in memorylocations (as in C) thus avoiding any illegal access to memory. This ensures that the Javacompiler performs a systematic verification of conversions.
  6. 6. OBJECTIVES GOALExplain the classes given in the programming field 2 during the academic year September 2012 to February 2013 SPECIFIC OBJECTIVEThrough classes studied a brief explanation to the teacher and classmates what is programming 2, all this will be explained in English.
  7. 7. THEORETICAL FRAMEWORKHow to start programming in Java?This part of the study material is not intended to address still concepts, butrather, you can configure any computer window xp or Windows 7 32 or 64 bitand get it ready to start programming.First of all: Installing "jdk-7u7-nb-7_2-windows-i586-ml" JDK "Java DevelopmentKit", will not only compile but run applications, available for a variety ofoperating systems:
  8. 8. FORM 1 :: Use the Shell vine run java code for this point is important to readand performers very well using the following commands: • javac.exe, compilergenerated files *. Apartir class source code (*. Java) . The *. Java is text, youcan create and edit in a text editor, using the syntax of Java.• Java.exe, systems interpreter for PC / Windows, executes bytecode files (filescompiled class extension). The *. Class have executable code, bytecode,platform independent, to be executed on a "hypothetical or virtual machine"called Java Virtual Machine (JVM). Is this JVM neutral who plays this codemaking a particular code on the CPU used. This avoids having to make adifferent program for each CPU or plataforma.1Remember watching the second image of this manual and look at the directorywhere javac command is located.1
  9. 9. Shell enters the system and see what happens when Digitas commands: javaor javac.You will realize that the javac command is not enabled, therefore the followingsteps and then try to use the command in question, the difference observed.To educate the system accepts this command indicating that we should add"environment variables" as indicated in the graph.Creating our first program in java then install an editor to start coding (in thiscase Notepad + +) After that, create the following program and save it in thedirectory "c: ProgramasJava"Note that the name of the file must be named identical to the class, using casesensitive. Finally run the program, first compile the program with javac and then running the java programm.
  10. 10. Interface (Java)A Java interface is a collection of abstract methods and properties. They specifywhat should be done but not its implementation. Will the classes that implementthese interfaces that describe the behavior logic methods.The main difference between interface and abstract is an interface that providesa mechanism for encapsulating protocols methods without forcing the user touse inheritance.Content1 Benefits2 Use2.1 Example3 External links Methods in java1. Statement methods.2. The term void.3. Using methods.1 Declaration of methodsIn Java all logic programming (algorithms) is grouped into functions or methods.One method is:A block of code that has a name,receives some parameters or arguments (optionally)contains statements or instructions to make something (optionally) andreturns a value of any known type (optionally).The overall syntax is:Tipo_Valor_devuelto nombre_método (lista_argumentos) { bloque_de_codigo;}
  11. 11. and the list of arguments is expressed by stating the type and name of thesame (as in variable declarations). If more than one are separated by commas.For example:sumaEnteros int (int a, int b) { int c = a + b; return c;}The method is called sumaEnteros.Also receives two integer parameters. Their names are a and b.Returns an integer.In the example the return clause is used to finalize the method returning thevalue of the variable c.2. The term voidThe fact that a method returns a value or not is optional. If that returns a valueis declared return type. But if you do not need a value, is declared return type,the keyword void. For example: haceAlgo void () { ... }When not return a value, the return clause is not necessary. Note that in thisexample the method also does not receive any parameters haceAlgo. Howeverparentheses are mandatory.3. Using methodsMethods are invoked by name, and passing the argument list in parentheses.The set is used like a variable type returned by the method.For example:int x;x = sumaEnteros (2.3);Note: This syntax is not complete, but it serves our purposes at this time. Thefull syntax will look when talking about objects.
  12. 12. Although the method does not receive any arguments, the parentheses in thecall are required. For example, to call the function haceAlgo, simply put:haceAlgo ();Note that since the function does not return a value is not assigned to anyvariable. (There is nothing to assign).AdvantageThe use of interfaces provides the following advantages:Organize your schedule (IAJU).Forcing certain classes use the same methods (names and parameters).Linking unrelated classes.UseJava provides two keywords to work with interfaces: interface and implements.To declare an interface is used: modificador_acceso NombreInterfaz interface { .... }modificador_acceso can be public or not exist, then the default package being.The attributes that define the interface body type attributes are constant inclasses in which it is implemented.To implement it in a class, use the form: modificador_acceso NombreInterfaz1 implements class ClassName [,NombreInterfaz2]A class can implement multiple interfaces, separating the names with commas.ExampleDefining an interface: Nave interface { / / Public static final int LIFE = 100, by definition, all attributes of aninterface are public, static / / And the end, and for that reason is redundant but if you write does notgenerate any error LIFE int end = 100;
  13. 13. public void moverPosicion (int x, int y); public void shoot (); ..... }Using the interface defined: public class Ship {NaveJugador implements public void moverPosicion (int x, int y) { / / Implementation of the method } public void fire () { / / Implementation of the method } ..... }
  14. 14. BIBLIOGRAPHY java.html