SlideShare una empresa de Scribd logo
1 de 3
Descargar para leer sin conexión
Class 3
       Exposure: Methods and Attributes Group #3
       Exposure: Group #4
       Instance Variables
       Class Variables
       Local variables




                            Methods and Attributes
METHODS.- The method has a pair of keys , among which is the code that will be executed
when the function call .

ATTRIBUTES.- Determine a storage structure for each class object

EJERCICIO.-
public class person {
private String name;

public void setearName (String value)
{
      name=value;
}
public void getName()
{
      System.out.println(name);

}
}
Instance Variables, Class Variables and Local variables

    Local variables.- those are that can be used anywhere in the program.
    Class Variables.- is typical of the class that contains.
    Instance Variables.- are used to define the attributes of an object.



public class student {
      private String name;
      private String surnameFather;
      private String surnameMother;
      private int age;
      public String specialty;

      int totaltelephone=0;
      String [] numbertelephono;
       public int averagePrevious;
       public int course;
       public void setData1 (String espec,int      proant,int course)
       {

              this.course=course;
                           if(curso>=4)
                           {
                                  specialty =spec;
                                  averagePrevious =aver;
                           }
                           else{
                                  averagePrevious =aver;
                           }
        }
      public void setdataFamily(String name,String surnameFather,String
surnameMother,int age)
      {
             this.name=name;
             this.surnamFather=surnameFather;
             this.surnameMother=surnameMother;
             this.age=age;
      }

      public void setTelephone(String Number)
      {
            totaltelephone++;
            numberTelephone=new String[numberTelephone];
            numberTelephone [numberTelephone -1]=Number;

      }
public void Data()
    {
           System.out.println(course);
         System.out.println(averagePrevious);
         System.out.println(specialty);
           System.out.println(name);
           System.out.println(surnameFather);
           System.out.println(surnameMother);
           System.out.println(age);
    }


}

Más contenido relacionado

Destacado

The stranger jose
The stranger jose The stranger jose
The stranger jose msvalcik
 
Portafolio de ingles carlos alcivar mera
Portafolio de ingles   carlos alcivar meraPortafolio de ingles   carlos alcivar mera
Portafolio de ingles carlos alcivar meraCarlos Alcivar
 
The stranger balanca
The stranger balancaThe stranger balanca
The stranger balancamsvalcik
 
The stranger.ppt niobe [recovered]
The stranger.ppt niobe [recovered]The stranger.ppt niobe [recovered]
The stranger.ppt niobe [recovered]msvalcik
 
High ticket sales funnel #3 launch funnel
High ticket sales funnel #3 launch funnelHigh ticket sales funnel #3 launch funnel
High ticket sales funnel #3 launch funnelDallas McMillan
 
High ticket sales funnel #2 webinar funnel
High ticket sales funnel #2 webinar funnelHigh ticket sales funnel #2 webinar funnel
High ticket sales funnel #2 webinar funnelDallas McMillan
 
Quesflickr 091013022733-phpapp02
Quesflickr 091013022733-phpapp02Quesflickr 091013022733-phpapp02
Quesflickr 091013022733-phpapp02LILIBETH MELO H
 

Destacado (12)

Class 5 2ciclo
Class 5 2cicloClass 5 2ciclo
Class 5 2ciclo
 
Class 7 2ciclo
Class 7 2cicloClass 7 2ciclo
Class 7 2ciclo
 
The stranger jose
The stranger jose The stranger jose
The stranger jose
 
Que es flickr?
Que  es flickr?Que  es flickr?
Que es flickr?
 
Portafolio de ingles carlos alcivar mera
Portafolio de ingles   carlos alcivar meraPortafolio de ingles   carlos alcivar mera
Portafolio de ingles carlos alcivar mera
 
Ingles portafolio
Ingles portafolioIngles portafolio
Ingles portafolio
 
The stranger balanca
The stranger balancaThe stranger balanca
The stranger balanca
 
The stranger.ppt niobe [recovered]
The stranger.ppt niobe [recovered]The stranger.ppt niobe [recovered]
The stranger.ppt niobe [recovered]
 
High ticket sales funnel #3 launch funnel
High ticket sales funnel #3 launch funnelHigh ticket sales funnel #3 launch funnel
High ticket sales funnel #3 launch funnel
 
High ticket sales funnel #2 webinar funnel
High ticket sales funnel #2 webinar funnelHigh ticket sales funnel #2 webinar funnel
High ticket sales funnel #2 webinar funnel
 
Quesflickr 091013022733-phpapp02
Quesflickr 091013022733-phpapp02Quesflickr 091013022733-phpapp02
Quesflickr 091013022733-phpapp02
 
Angular js
Angular jsAngular js
Angular js
 

Similar a Class 3 2ciclo

CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodecamp Romania
 
Explain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptExplain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptayaankim007
 
public class Person { private String name; private int age;.pdf
public class Person { private String name; private int age;.pdfpublic class Person { private String name; private int age;.pdf
public class Person { private String name; private int age;.pdfarjuncp10
 
Java essence part 1
Java essence part 1Java essence part 1
Java essence part 1HanRu Yeh
 
Hello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfHello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfirshadkumar3
 
About java
About javaAbout java
About javaJay Xu
 
Assignment 7
Assignment 7Assignment 7
Assignment 7IIUM
 
encapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingencapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingShivam Singhal
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfformaxekochi
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#Doncho Minkov
 
Simple class and object examples in java
Simple class and object examples in javaSimple class and object examples in java
Simple class and object examples in javaHarish Gyanani
 
Corejava Training in Bangalore Tutorial
Corejava Training in Bangalore TutorialCorejava Training in Bangalore Tutorial
Corejava Training in Bangalore Tutorialrajkamaltibacademy
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timekarianneberg
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Ayes Chinmay
 

Similar a Class 3 2ciclo (20)

CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
 
Explain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptExplain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).ppt
 
public class Person { private String name; private int age;.pdf
public class Person { private String name; private int age;.pdfpublic class Person { private String name; private int age;.pdf
public class Person { private String name; private int age;.pdf
 
Java essence part 1
Java essence part 1Java essence part 1
Java essence part 1
 
Polymorphism.pptx
Polymorphism.pptxPolymorphism.pptx
Polymorphism.pptx
 
Generics
GenericsGenerics
Generics
 
Hello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfHello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdf
 
OOP Lab Report.docx
OOP Lab Report.docxOOP Lab Report.docx
OOP Lab Report.docx
 
3 j unit
3 j unit3 j unit
3 j unit
 
About java
About javaAbout java
About java
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
 
Assignment 7
Assignment 7Assignment 7
Assignment 7
 
encapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingencapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloading
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdf
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Simple class and object examples in java
Simple class and object examples in javaSimple class and object examples in java
Simple class and object examples in java
 
Corejava Training in Bangalore Tutorial
Corejava Training in Bangalore TutorialCorejava Training in Bangalore Tutorial
Corejava Training in Bangalore Tutorial
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en time
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 

Más de Carlos Alcivar

Gestor de proyectos_de_clase
Gestor de proyectos_de_claseGestor de proyectos_de_clase
Gestor de proyectos_de_claseCarlos Alcivar
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aCarlos Alcivar
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aCarlos Alcivar
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aCarlos Alcivar
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aCarlos Alcivar
 

Más de Carlos Alcivar (8)

Gestor de proyectos_de_clase
Gestor de proyectos_de_claseGestor de proyectos_de_clase
Gestor de proyectos_de_clase
 
Class 6 2ciclo
Class 6 2cicloClass 6 2ciclo
Class 6 2ciclo
 
Class 4 2ciclo
Class 4 2cicloClass 4 2ciclo
Class 4 2ciclo
 
Class 1 y 2 2ciclo
Class 1 y 2 2cicloClass 1 y 2 2ciclo
Class 1 y 2 2ciclo
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 a
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 a
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 a
 
Portafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 aPortafolio calculo diferencial 2 a
Portafolio calculo diferencial 2 a
 

Class 3 2ciclo

  • 1. Class 3  Exposure: Methods and Attributes Group #3  Exposure: Group #4  Instance Variables  Class Variables  Local variables Methods and Attributes METHODS.- The method has a pair of keys , among which is the code that will be executed when the function call . ATTRIBUTES.- Determine a storage structure for each class object EJERCICIO.- public class person { private String name; public void setearName (String value) { name=value; } public void getName() { System.out.println(name); } }
  • 2. Instance Variables, Class Variables and Local variables  Local variables.- those are that can be used anywhere in the program.  Class Variables.- is typical of the class that contains.  Instance Variables.- are used to define the attributes of an object. public class student { private String name; private String surnameFather; private String surnameMother; private int age; public String specialty; int totaltelephone=0; String [] numbertelephono; public int averagePrevious; public int course; public void setData1 (String espec,int proant,int course) { this.course=course; if(curso>=4) { specialty =spec; averagePrevious =aver; } else{ averagePrevious =aver; } } public void setdataFamily(String name,String surnameFather,String surnameMother,int age) { this.name=name; this.surnamFather=surnameFather; this.surnameMother=surnameMother; this.age=age; } public void setTelephone(String Number) { totaltelephone++; numberTelephone=new String[numberTelephone]; numberTelephone [numberTelephone -1]=Number; }
  • 3. public void Data() { System.out.println(course); System.out.println(averagePrevious); System.out.println(specialty); System.out.println(name); System.out.println(surnameFather); System.out.println(surnameMother); System.out.println(age); } }