Results 1 to 2 of 2
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Rep Power

    Default how the private method is calling

    hi all,

    i using spring framework,
    i that there is a class ADaoImpl,i want to check a field that is send from action class (struts2)is also integrated,is in proper format.
    for example a date field which need to be dd/MM/yyyy.
    to check this
    Java Code:
    private boolean isValidDate(String data) {
    		boolean flag = false;
    		SimpleDateFormat dateFormat = null;
    		if (null != data && data.length() > 0) {
    			try {
    				dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    				flag = true;
    			} catch (ParseException e) {
    				// e.printStackTrace();
    				flag = false;
    		return flag;
    if the flag is true then insert the value.
    Java Code:
    if (isValidDate(date))
    but "isValidDate" is not a static method then how this method is calling ,i 'm getting this method called

    who is calling this method ,or how is this method called.

    thanks in advance

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: how the private method is calling

    Put a break point in there somewhere and use the debugger for whatever IDE you have.
    Then when it hits the breakpoint you'll see, in the stack trace all debuggers have access to, exactly where it's been called from.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 4
    Last Post: 09-24-2012, 01:08 AM
  2. Calling private int from another java file
    By Mod3rn in forum New To Java
    Replies: 4
    Last Post: 01-02-2012, 10:22 PM
  3. private int method - if statement
    By scottmulla in forum New To Java
    Replies: 2
    Last Post: 03-31-2011, 08:57 AM
  4. More than one input in one private method
    By rice in forum New To Java
    Replies: 0
    Last Post: 10-02-2009, 06:08 AM
  5. cannot call private method from static method
    By jon80 in forum New To Java
    Replies: 3
    Last Post: 05-07-2008, 09:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts