Não deixe de estudar. É uma tendência mas existem outliers! :-P

Abraço

Peter P. Lupo
http://craftnicely.blogspot.com - http://sites.google.com/site/pplupo
MPS.BR Authorized Implementation Practitioner - Certified ScrumMaster
Sun Certified Java Associate - Java Brown Belt
+55 (021) 81742487


2010/4/21 Romulo Freires <[email protected]>

> Peter, se o grafico estiver certo, isso significa que eu vou está bem
> tranquilo depois da p1 segunda.
>
> abraços
>
> Em 21 de abril de 2010 19:17, Peter P. Lupo <[email protected]> escreveu:
>
>> Isso Romulo, mas ela não tinha feito o getter.
>>
>> Abraço
>>
>> Peter P. Lupo
>> http://craftnicely.blogspot.com - http://sites.google.com/site/pplupo
>> MPS.BR Authorized Implementation Practitioner - Certified ScrumMaster
>> Sun Certified Java Associate - Java Brown Belt
>> +55 (021) 81742487
>>
>>
>> 2010/4/21 Romulo Freires <[email protected]>
>>
>>>  eu acessei elas dessa forma
>>>
>>> getCargo().getValorHor
>>>
>>> Uma vez que na classe trabalhor existe
>>>
>>> this.cargo = Cargo.valueOf(cargo.toUpperCase()); no construtor
>>>
>>> e o método
>>>
>>> public Cargo getCargo() {
>>>         return cargo;
>>>
>>>
>>>
>>>>   Lupo <[email protected]>
>>>>
>>>> ;-)
>>>>>
>>>>>
>>>>> Abraço
>>>>>
>>>>> Peter P. Lupo
>>>>>
>>>>> http://craftnicely.blogspot.com - http://sites.google.com/site/pplupo
>>>>> MPS.BR Authorized Implementation Practitioner - Certified ScrumMaster
>>>>> Sun Certified Java Associate - Java Brown Belt
>>>>> +55 (021) 81742487
>>>>>
>>>>>
>>>>> 2010/4/21 Kate <[email protected]>
>>>>>
>>>>> Oi Peter...
>>>>>>
>>>>>> Tava faltando um getCargo na classe Trabalhador e eu estava utilizando
>>>>>> ele de forma errada nas subclasses!
>>>>>>
>>>>>> Obrigada!
>>>>>>
>>>>>>
>>>>>> On 21 abr, 17:18, "Peter P. Lupo" <[email protected]> wrote:
>>>>>> > Não sei se o problema é exatamente este mas eu vou chutar o que eu
>>>>>> acho que
>>>>>> > é mais provável de estar acontecendo:
>>>>>> >
>>>>>> > 1- O atributo cargo é private na superclasse (trabalhador).
>>>>>> >     Private limita a visibilidade para a classe onde foi declarado
>>>>>> apenas.
>>>>>> > As subclasses não enxergam.
>>>>>> > 2- Nas subclasses você está tentando acessar o atributo diretamente.
>>>>>> Logo,
>>>>>> > não terá visibilidade.
>>>>>> >
>>>>>> > Se você quiser acessar diretamente, terá que tirar o modificador
>>>>>> private.
>>>>>> > Qualquer outro vai servir. Eu desaconselho.
>>>>>> >
>>>>>> > A minha sugestão é que vc crie um getter com outro modificador que
>>>>>> não seja
>>>>>> > private (public talvez) e acesse através deste.
>>>>>> >
>>>>>> > Veja se ajudou.
>>>>>> >
>>>>>> > Abraço
>>>>>> >
>>>>>> > Peter P. Lupohttp://craftnicely.blogspot.com-
>>>>>> http://sites.google.com/site/pplupo
>>>>>> > MPS.BR Authorized Implementation Practitioner - Certified
>>>>>> ScrumMaster
>>>>>> > Sun Certified Java Associate - Java Brown Belt
>>>>>> > +55 (021) 81742487
>>>>>> >
>>>>>> > 2010/4/21 Kate <[email protected]>
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > > Bom,
>>>>>> >
>>>>>> > > Meu problema é que não consigo acessar o valorHora e o
>>>>>> > > limiteMaximoHoras quando estou trabalhando nas classes
>>>>>> > > TrabalhadorHorista ou TrabalhadorAssalariado.
>>>>>> >
>>>>>> > > O eclipse pede que uma das coisas sejam feitas: Criação de uma
>>>>>> > > variavel local, de um parametro ou de uma constante com esses
>>>>>> nomes.
>>>>>> >
>>>>>> > > Acredito que o problema esteja na classe Trabalhador, pq é através
>>>>>> de
>>>>>> > > Cargo cargo que eu teria acesso a essas variáveis  ou que eu
>>>>>> esteja
>>>>>> > > tentando esse acesso de forma errada.
>>>>>> >
>>>>>> > > Alguma sugestão?
>>>>>> >
>>>>>> > > --
>>>>>> > > You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> > > "Comp 2 - Geral" group.
>>>>>> > > To post to this group, send email to [email protected]
>>>>>> .
>>>>>> > > To unsubscribe from this group, send email to
>>>>>> > > [email protected]<comp2-geral%[email protected]>
>>>>>> <comp2-geral%2bunsubscr...@googlegr oups.com>
>>>>>> > > .
>>>>>> > > For more options, visit this group at
>>>>>> > >http://groups.google.com/group/comp2-geral?hl=en.
>>>>>> >
>>>>>> > --
>>>>>> > You received this message because you are subscribed to the Google
>>>>>> Groups "Comp 2 - Geral" group.
>>>>>> > To post to this group, send email to [email protected].
>>>>>> > To unsubscribe from this group, send email to
>>>>>> [email protected]<comp2-geral%[email protected]>
>>>>>> .
>>>>>> > For more options, visit this group athttp://
>>>>>> groups.google.com/group/comp2-geral?hl=en.
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Comp 2 - Geral" group.
>>>>>> To post to this group, send email to [email protected].
>>>>>> To unsubscribe from this group, send email to
>>>>>> [email protected]<comp2-geral%[email protected]>
>>>>>> .
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/comp2-geral?hl=en.
>>>>>>
>>>>>>
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Comp 2 - Geral" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected]<comp2-geral%[email protected]>
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/comp2-geral?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Comp 2 - Geral" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<comp2-geral%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/comp2-geral?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Comp 2 - Geral" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<comp2-geral%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/comp2-geral?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Comp 2 - Geral" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<comp2-geral%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/comp2-geral?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Comp 
2 - Geral" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/comp2-geral?hl=en.

Responder a