Click here to Skip to main content
15,889,720 members
Home / Discussions / Java
   

Java

 
Questioncoffee shop management system in java Pin
Hussain Anwer6-Mar-16 2:52
Hussain Anwer6-Mar-16 2:52 
AnswerRe: coffee shop management system in java Pin
Richard MacCutchan6-Mar-16 4:20
mveRichard MacCutchan6-Mar-16 4:20 
QuestionCustom Browser Pin
sandeep kamara26-Feb-16 18:06
sandeep kamara26-Feb-16 18:06 
AnswerRe: Custom Browser Pin
Richard MacCutchan26-Feb-16 21:57
mveRichard MacCutchan26-Feb-16 21:57 
Questioncore java (Singleton pattern ) Pin
Hiren Akbari25-Feb-16 6:45
professionalHiren Akbari25-Feb-16 6:45 
AnswerRe: core java (Singleton pattern ) Pin
NickPace25-Feb-16 7:00
NickPace25-Feb-16 7:00 
QuestionHow to use setters and getters. Pin
Member 1234728623-Feb-16 14:49
Member 1234728623-Feb-16 14:49 
AnswerRe: How to use setters and getters. Pin
Richard MacCutchan23-Feb-16 21:26
mveRichard MacCutchan23-Feb-16 21:26 
Setters and Getters are used to hide the implementation of fields in an object, and just provide a convenient method to save or return a value. At its most basic level you could have something like:
Java
private double taxAmount;
public double getTaxAmount()
{
    //include more logic
    return taxAmount;
}
public void setTaxAmount(double value)
{
    //include validation, logic, logging or whatever you like here
    taxAmount = value;
}

If the implementation of the field changes then it should only be necessary to modify the setter and getter thus avoiding changes to the code in the rest of the class.
GeneralMessage Closed Pin
25-Mar-20 19:16
Sherin_Mathew25-Mar-20 19:16 
GeneralRe: How to use setters and getters. Pin
Richard MacCutchan25-Mar-20 21:29
mveRichard MacCutchan25-Mar-20 21:29 
GeneralRe: How to use setters and getters. Pin
OriginalGriff16-Apr-20 0:06
mveOriginalGriff16-Apr-20 0:06 
GeneralRe: How to use setters and getters. Pin
Richard MacCutchan16-Apr-20 0:43
mveRichard MacCutchan16-Apr-20 0:43 
QuestionHow to fetch the data from pos to my application Pin
Vandip11-Feb-16 12:22
Vandip11-Feb-16 12:22 
AnswerRe: How to fetch the data from pos to my application Pin
Richard MacCutchan11-Feb-16 21:10
mveRichard MacCutchan11-Feb-16 21:10 
QuestionDouble variable and array working in java Pin
Indan10-Feb-16 7:18
Indan10-Feb-16 7:18 
AnswerRe: Double variable and array working in java Pin
jschell12-Feb-16 12:35
jschell12-Feb-16 12:35 
Questionhow to use selenium webdriver with existing firefox browser Pin
neodeaths3-Feb-16 5:38
neodeaths3-Feb-16 5:38 
Questionusing "while" reverse the digits of the number in java? Pin
Member 123033992-Feb-16 8:05
Member 123033992-Feb-16 8:05 
AnswerRe: using "while" reverse the digits of the number in java? Pin
Richard Andrew x642-Feb-16 8:15
professionalRichard Andrew x642-Feb-16 8:15 
GeneralREPOST Pin
Sascha Lefèvre2-Feb-16 8:28
professionalSascha Lefèvre2-Feb-16 8:28 
Questionget the context path in jsp Pin
Member 1026351929-Jan-16 21:27
Member 1026351929-Jan-16 21:27 
Generaljava Pin
Hiren Akbari27-Jan-16 5:49
professionalHiren Akbari27-Jan-16 5:49 
QuestionRe: java Pin
Richard MacCutchan27-Jan-16 6:28
mveRichard MacCutchan27-Jan-16 6:28 
GeneralRe: java Pin
iskSYS24-Feb-16 22:09
professionaliskSYS24-Feb-16 22:09 
Questionhow to read large 8gb json text file in java program Pin
Member 1216598526-Jan-16 19:02
Member 1216598526-Jan-16 19:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.