Class 3       Exposure: Methods and Attributes Group #3       Exposure: Group #4       Instance Variables       Class ...
Instance Variables, Class Variables and Local variables    Local variables.- those are that can be used anywhere in the p...
public void Data()    {           System.out.println(course);         System.out.println(averagePrevious);         System....
Upcoming SlideShare
Loading in …5
×

Class 3 2ciclo

194 views
128 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
194
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Class 3 2ciclo

  1. 1. Class 3  Exposure: Methods and Attributes Group #3  Exposure: Group #4  Instance Variables  Class Variables  Local variables Methods and AttributesMETHODS.- The method has a pair of keys , among which is the code that will be executedwhen the function call .ATTRIBUTES.- Determine a storage structure for each class objectEJERCICIO.-public class person {private String name;public void setearName (String value){ name=value;}public void getName(){ System.out.println(name);}}
  2. 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,StringsurnameMother,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. 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); }}

×