Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what does this do?

 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this line of code do and where does it point?

public void setStartDate(java.sql.Date value) { startDate=value; }
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Patrick Mallahan:

public void setStartDate(java.sql.Date value) { startDate=value; }


This is a public method that takes in an argument of type java.sql.Date. It assigns that argument to what appears to be a class variable of the same type or a supertype named startDate.

As to where it points, I don't understand that question.
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it a class for the code, or is it storing info in an SQL database?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Patrick Mallahan:
is it a class for the code, or is it storing info in an SQL database?


As Steven said, it's assigning a value to a member variable. It has nothing to do with a database of any kind.
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay i get it. it is setting something to the value of YYYYMMDD. cool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic