SlideShare ist ein Scribd-Unternehmen logo
1 von 5
Downloaden Sie, um offline zu lesen
Kenia Álava
Step by step creation of the first program in Java using
                           Eclipse
1. Run the sequence of actions detailed in the chart.




2. Run after the sequence of actions detailed in the chart.




                                                              Kenia Álava
3. Insert a class called "PruebaAlbum" as follows.




4. Now insert a class called "Album", in the same way as the previous step

5. The result after the above steps is a structure as follows.




6. Declare the following attributes within the class "Album"




                                                                       Kenia Álava
7. Then set the SET and GET methods (methods are inserting, modifying and extracting the
values that variables may have happened before, "automatically generated"), this
operation is called to create getters and setters.




8. Notice how you generated the following code block without you had to write

9. Define the following constructor.

The constructor is a method that must have the same name as the class and is used to
initialize the attributes of an object, usually receives values that have happened, a quick
way is to develop a method using getters and setters from the previous step.




                                                                       Kenia Álava
10. Now we instantiate an object of class "Album" in class

"PruebaAlbum", this instance or reference to create should be made in the main.




See how you created two instances, and the way in which you can send arguments.



11. In the previous step we created two instances, how can we show these values on
screen?

We must develop a new method in the "Album", will be called "PRINT Album"




12. Then call the method created from the two instances declared in step 10.




13. And finally see the execution, after clicking on the button should appear something as
follows:




                                                                      Kenia Álava

Weitere ähnliche Inhalte

Ähnlich wie Class 2

Java Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfJava Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfbhim1213
 
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docx
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docxPage 8 of 83.Tutorial Get Started with Eclipse in the Compute.docx
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docxalfred4lewis58146
 
Lect 1-java object-classes
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classesFajar Baskoro
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfarpitaeron555
 
New Microsoft Word Document.doc
New Microsoft Word Document.docNew Microsoft Word Document.doc
New Microsoft Word Document.docbutest
 
Object Oriented Programming in Android Studio
Object Oriented Programming in Android StudioObject Oriented Programming in Android Studio
Object Oriented Programming in Android StudioMahmoodGhaemMaghami
 

Ähnlich wie Class 2 (12)

Simple Java component in Mule
Simple Java component in MuleSimple Java component in Mule
Simple Java component in Mule
 
Class 1 blog
Class 1 blogClass 1 blog
Class 1 blog
 
Class 1
Class 1Class 1
Class 1
 
Class 1
Class 1Class 1
Class 1
 
Java Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdfJava Program Photo Viewer1. Write an app called viewer that will .pdf
Java Program Photo Viewer1. Write an app called viewer that will .pdf
 
Class 1
Class 1Class 1
Class 1
 
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docx
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docxPage 8 of 83.Tutorial Get Started with Eclipse in the Compute.docx
Page 8 of 83.Tutorial Get Started with Eclipse in the Compute.docx
 
Lect 1-java object-classes
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classes
 
Java
JavaJava
Java
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdf
 
New Microsoft Word Document.doc
New Microsoft Word Document.docNew Microsoft Word Document.doc
New Microsoft Word Document.doc
 
Object Oriented Programming in Android Studio
Object Oriented Programming in Android StudioObject Oriented Programming in Android Studio
Object Oriented Programming in Android Studio
 

Mehr von Miguel Mastarreno Macías (20)

Portafolio kenia original 2 a
Portafolio kenia original 2 aPortafolio kenia original 2 a
Portafolio kenia original 2 a
 
Class 1 y 2 2ciclo
Class 1 y 2 2cicloClass 1 y 2 2ciclo
Class 1 y 2 2ciclo
 
Proyecto
ProyectoProyecto
Proyecto
 
Proyecto de ingles traducido
Proyecto de ingles traducidoProyecto de ingles traducido
Proyecto de ingles traducido
 
Class 6
Class 6Class 6
Class 6
 
Class 5
Class 5Class 5
Class 5
 
Class 4
Class 4Class 4
Class 4
 
Class 3
Class 3Class 3
Class 3
 
Kenii
KeniiKenii
Kenii
 
Gissy
GissyGissy
Gissy
 
Aby
AbyAby
Aby
 
Folder
FolderFolder
Folder
 
Gestor proyectocalculo
Gestor proyectocalculoGestor proyectocalculo
Gestor proyectocalculo
 
Diapositivas avance calculo
Diapositivas avance calculoDiapositivas avance calculo
Diapositivas avance calculo
 
Proyecto kenia gisse miguel aby
Proyecto kenia gisse miguel abyProyecto kenia gisse miguel aby
Proyecto kenia gisse miguel aby
 
Calculo mastarreno
Calculo mastarrenoCalculo mastarreno
Calculo mastarreno
 
Calculo folder gisy.editado
Calculo folder gisy.editadoCalculo folder gisy.editado
Calculo folder gisy.editado
 
Keniia fold calculo original
Keniia fold calculo originalKeniia fold calculo original
Keniia fold calculo original
 
Keniia fold calculo original
Keniia fold calculo originalKeniia fold calculo original
Keniia fold calculo original
 
Ciencias astronimicas
Ciencias astronimicasCiencias astronimicas
Ciencias astronimicas
 

Class 2

  • 2. Step by step creation of the first program in Java using Eclipse 1. Run the sequence of actions detailed in the chart. 2. Run after the sequence of actions detailed in the chart. Kenia Álava
  • 3. 3. Insert a class called "PruebaAlbum" as follows. 4. Now insert a class called "Album", in the same way as the previous step 5. The result after the above steps is a structure as follows. 6. Declare the following attributes within the class "Album" Kenia Álava
  • 4. 7. Then set the SET and GET methods (methods are inserting, modifying and extracting the values that variables may have happened before, "automatically generated"), this operation is called to create getters and setters. 8. Notice how you generated the following code block without you had to write 9. Define the following constructor. The constructor is a method that must have the same name as the class and is used to initialize the attributes of an object, usually receives values that have happened, a quick way is to develop a method using getters and setters from the previous step. Kenia Álava
  • 5. 10. Now we instantiate an object of class "Album" in class "PruebaAlbum", this instance or reference to create should be made in the main. See how you created two instances, and the way in which you can send arguments. 11. In the previous step we created two instances, how can we show these values on screen? We must develop a new method in the "Album", will be called "PRINT Album" 12. Then call the method created from the two instances declared in step 10. 13. And finally see the execution, after clicking on the button should appear something as follows: Kenia Álava