Properties | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Properties

Hey does anyone know how to add properties to a method in java?

16th Nov 2016, 1:09 PM
Omari Dipari
Omari Dipari - avatar
2 Answers
+ 1
public int var = 2; - Declare the encapsulation type - Declare the data type - Declare the variable name - Assign it a value eg =2. (this step is optional).
17th Nov 2016, 10:49 AM
Toheeb
Toheeb - avatar
0
Oh ok...I definitely have to look into this some more
19th Nov 2016, 11:52 PM
Omari Dipari
Omari Dipari - avatar