## mardi 22 mars 2016

I have problem with understanding how the methods below work. I have class Calc and method for multiplication, first method use typical getters, second method can access straight to private attribute with type conversion. My question is, how it is possible, that number1 have access to number2's private attribute.

``````private int number;

public Calc multiplication(Calc z)
{
return new Calc(this.number*z.getNumber());
}

public Calc multiplication(Calc z)
{
return new Calc(this.number*((Calc)z).number);
}

test()
{
number1 = new Calc(2);
number2 = new Calc(3);
number1.multiplication(number2);
}
```
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.7424215,"math_prob":0.99261653,"size":683,"snap":"2022-05-2022-21","text_gpt3_token_len":147,"char_repetition_ratio":0.14874816,"word_repetition_ratio":0.06666667,"special_character_ratio":0.22401172,"punctuation_ratio":0.15833333,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99379116,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-26T07:25:45Z\",\"WARC-Record-ID\":\"<urn:uuid:2353dd1f-e945-46a2-af08-3c3e359dbd1e>\",\"Content-Length\":\"53836\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:87b31d91-a5de-4102-97d2-d29c640e7c58>\",\"WARC-Concurrent-To\":\"<urn:uuid:f625d741-b741-472f-86c8-9cdd5a925c64>\",\"WARC-IP-Address\":\"172.217.1.193\",\"WARC-Target-URI\":\"https://3d-grphique.blogspot.com/2016/03/java-access-to-members-with-type.html\",\"WARC-Payload-Digest\":\"sha1:EQTING4MHBFETUXIFJ5N2DFTNNDYTZ7O\",\"WARC-Block-Digest\":\"sha1:4OT6RV2MNSO6LL5IYKILVJ426GXKUBX7\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662604495.84_warc_CC-MAIN-20220526065603-20220526095603-00207.warc.gz\"}"}