What does "values", "data" and "field" mean in java ?
For example, definition of encapsulation is hiding of data in a class and making this class available only through methods. In this way the chance of making accidental mistakes in changing "values" is minimized.
In access specifiers, Java allows us to control access to classes, methods, and "fields" via so-called access specifiers.
Please anyone explain that what does values and fields mean and does data means code in java ??
Those 3 terms are all very similar, and people will use them almost interchangeably. But here's my attempt to distinguish the main uses of them, while ignoring some of the more obscure exceptions: Data is everything that's not executable code. It's the ints, booleans, bytes, Strings, arrays etc that a program uses and creates, eg 101, "James".
A value is the data associated with a variable or field, eg String personName = "James" ... the data "James" is the value of the variable personName.
Field is a word from the Object-Oriented world. When you define a class it has methods and fields. Fields will typically be implemented as variables in the class (but not necessarily - that's what data hiding is about), and accessed via public setter and getter (mutator and accessor) methods. Fields have values, which are examples of data.
Does that help?
Maybe someone else can explain it better...
ps. Yes, I deliberately didn't talk about references to objects; first things first, time enough for that later.
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...