Please give  me example of delimiter in scanner

Please anyone give me information,I need an example of Scanner method where I can validate an integer date with delimiter
example -
dd-mm-yyyy The dash "-" must come in between the dates while the user types the date like 27- 4 -

I am trying to insert a particular date from scanner method but I am getting error as incompatible type found String expected Date, I tried parser but it didn't work, please check the code and let me can you correct it, I want to enter date through scanner date like 09-06-2008
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.*;
import java.util.Date;
public class Example
// instance variables - replace the example below with your own
Scanner scan=new Scanner(System.in);
public void date()
Date date = new Date();
date = scan.next();
String DATE_FORMAT = "MM/dd/yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
System.out.println("Today is " + sdf.format(date) );
}

Similar Messages

  • How to use getAncestor(n),getdescendant(child,child) in sql why they are use please give me example

    how to use getAncestor(n),getdescendant(child,child) in sql why they are use please give me example
    jitendra

    Below are a few examples that demonstrate these hierarchyid data type methods.  See the hierarchyid reference in the SQL Server Books Online for more examples of these and other methods (http://technet.microsoft.com/en-us/library/bb677193.aspx).
    --return a child of this node ('/1/')
    SELECT CAST('/' AS hierarchyid).GetDescendant(NULL, NULL).ToString();
    --returns a child of this node greater than child node '/1/' ('/2/')
    SELECT CAST('/' AS hierarchyid).GetDescendant(CAST('/1/' AS hierarchyid), NULL).ToString();
    --returns a child of this node less than chold node '/1/' ('/0/')
    SELECT CAST('/' AS hierarchyid).GetDescendant(NULL, CAST('/1/' AS hierarchyid)).ToString();
    --returns a child of this node greater than child node '/1/' and less than child node '/2/' ('/1.1/')
    SELECT CAST('/' AS hierarchyid).GetDescendant(CAST('/1/' AS hierarchyid), CAST('/2/' AS hierarchyid)).ToString();
    --return ancestor of node 1 level up from this node ('/1/2/')
    SELECT CAST('/1/2/3/' AS hierarchyid).GetAncestor(1).ToString();
    --return ancestor of node 2 levels up from this node ('/1/')
    SELECT CAST('/1/2/3/' AS hierarchyid).GetAncestor(2).ToString();
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Struts using DAO Design Pattern ..?Please give an example..... URGENT......

    Dear all,
    I have to develop an application in Struts by using DAO design pattern ..........
    Please give an example on Struts using DAO...................
    Thank you
    Please

    I'm glad you asked. It means Read The Flaming Manual. That'd be the struts manual by the way.

  • What is IMPORT/EXORT statements ?please give some example code?

    What is IMPORT/EXORT statements ?please give some example code?

    EXPORT :-To read data objects from an ABAP program into ABAP memory, use the following statement:
    Syntax
    EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.
    This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM <f i >, the data object <f i > is saved under its own name. If you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    The EXPORT statement always completely overwrites the contents of any existing data cluster with the same name <key>.
    IMPORT :-To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    they are used to save and reterive data in ABAP memory.
    here is an example to clear about them.
    <b>REPORT ZWA_TEST2 .
    data: it_bkpf type table of bkpf with header line.
    SELECT * FROM bkpf into table it_bkpf.
    EXPORT it_bkpf TO MEMORY ID 'MID'.
    refresh it_bkpf.
    IMPORT it_bkpf FROM MEMORY ID 'MID'.
    LOOP AT It_bkpf.
    write:/ it_bkpf-belnr.
    ENDLOOP.</b>
    Reward points if it is useful.......

  • Need example of delimiter of Scanner method for breaking the values

    Please give me an example of the delimiter method of Scanner class from which I can break up a value for example
    if a user enters from scanner credit card number 12-56789-8990 "-" dash must occur in between. like this format xx-xxxxxx-xxxxx-xx.

    Guess what, there's a discussion going on about the very same topic here.
    You wouldn't happen to have two user accounts for flame-free cross posting, would you?
    db

  • Please give flashINflex example

    Please, as I am new in AS3 and flex. I have just downloaded
    trial version of flex 3 and I already am owner of Adobe Creative
    Suite so I have Flash CS3.
    What I am asking is: can someone please point me where I
    could fine example of Fx applicaion loading and communicating with
    flash 9 (AS3) file and vice versa.
    What I would like to learn is: how flex send / read variables
    from loaded flash movie, and how flash component (or movie) can
    access flex variables or control flex application (fe. change
    views, go back, refresh data...).
    In advance, thank you for helping me with this.

    Perhaps start here:
    http://weblogs.macromedia.com/pent/archives/2007/04/example_of_the.cfm
    Tracy

  • How to convert an Interactive report to ALV report..please give a example..

    Hi experts,
    How to convert an interactive report to ALV report..plz suggest me an example...
    thanks in advance,
    Varsha.

    hi varsha,
    chk this link.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
    you will get good idea.
    use this FM.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE' 
                I_callback_user_command = 'USER_COMMAND' 
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]      "create a field catlog.
                i_save                  = 'X'
           tables
                t_outtab                = it_tab        "pass the final internal table.
           exceptions
                program_error           = 1
                others                  = 2.
    Regards
    Anver

  • How can I run a BW Function from EXCEL-IN-PLACE (BPS)??? Please give any ex

    How can I run a BW Function from EXCEL-IN-PLACE (BPS)using VBA??? Please give any example.
    I would like to run my function module ZMY from EXCEL-IN-PLACE using VBA and get a result.

    if you are using excel in place in the web application environment I doubt you can, you've never really had any macro functionalty there.
    If you are in the gui environemnt (Planning folders) it will depend on how you want to invoke the module...

  • In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    Hi 
    CAC is System.ConsolidatorCondition condition detection module used to consolidate the monitoring i.e. you can generate an alert on multiple occurrence of issues instituted of generating single alert for issue.
    refer below link for more information
    http://msdn.microsoft.com/en-us/library/ee809324.aspx
    http://social.technet.microsoft.com/wiki/contents/articles/20301.how-to-add-consolidation-for-url-monitoring-in-scom-20072012.aspx
    Regards
    sridhar v

  • Regarding how to use index , please give me some example if possible

    Hello everybody:
           Thank you all for your help in  advance .
           would you please tell me how to use index, please give me  some example if possible.  couldn't thank you more!
          best regards .
         Frank

    Index is used for faster access of data base tables.
    An index helps to speed up selection from the database. An index is a sorted copy of selected database table fields.
    The primary index is always automatically created in an ABAP-based SAP system. It consists of the primary key fields of the database table. This means, for each combination of the index fields exists a maximum of one record in the table. This kind of index is called a UNIQUE index.
    If the primary index cannot be used to determine selection result, (for example, the WHERE condition does not contain any primary index fields), the system searches the whole table. To prevent this, and determine the selection result by searching through a restricted number of database records, you can create a secondary index.
    However, you should not define an index for all possible fields in the WHERE condition.
    Check this thread..u have more details.
    In which situation we can use the reading of  index

  • PLEASE GIVE ME AN EXAMPLE OF A "USER NAME"

    I cannot understand why the user name I tried to register was not accepted. Please give me an example of a "User name"
    == This happened ==
    Every time Firefox opened

    Here I am: Wikiwide, registered today.
    And there is also: TXGuy, who has 3043 posts.
    And: zzxc, 495 posts.
    And: the-edmeister, 27519 posts.
    And: cor-el, 73190 posts.
    So:
    letters, both small and large, are accepted;
    no spaces, no underscores;
    one - can be used;
    username can certainly be from 4 to 13 characters long, maybe longer.

  • What is left join /right join / out join/ inner join/please give example!

    what is left join /right join / out join/ inner join/please give example!
    thanks

    Maybe these examples will give you an idea...
    SQL> select * from t1;
            ID
             1
             2
             3
             4
    SQL> select * from t2;
            ID
             3
             4
             5
             6
    -- LEFT OUTER JOIN
    SQL> select t1.id, t2.id
      2  from t1 LEFT OUTER JOIN t2 ON (t1.id = t2.id);
            ID         ID
             3          3
             4          4
             1
             2
    -- RIGHT OUTER JOIN
    SQL> select t1.id, t2.id
      2  from t1 RIGHT OUTER JOIN t2 ON (t1.id = t2.id);
            ID         ID
             3          3
             4          4
                        6
                        5
    -- LEFT JOIN (SAME AS LEFT OUTER JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 LEFT JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
             1
             2
    -- RIGHT JOIN (SAME AS RIGHT OUTER JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 RIGHT JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
                        6
                        5
    -- INNER JOIN (REGULAR JOIN)
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 INNER JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
    -- FULL OUTER JOIN
    SQL> ed
    Wrote file afiedt.buf
      1  select t1.id, t2.id
      2* from t1 FULL OUTER JOIN t2 ON (t1.id = t2.id)
    SQL> /
            ID         ID
             3          3
             4          4
             1
             2
                        6
                        5
    6 rows selected.
    SQL>

  • Could you please give me an example of reconcilation and consolidation for

    Hi all:
    could you please give me an example of reconcilation and consolidation for ODS?
    Thank you very much1

    could you please give me an example of reconcilation and consolidation for ODS?
    like we can take example like this.
    from different data sources we get data in to one dso and consolidate the data before making availabe to reporting.
    we will remove duplicates if any,

  • Hi SAP FI/CO GURUS ...... PLEASE GIVE ME INTERVIEW QUESTIONS ON SAP FI/CO

    Hi FI/CO gurus
    I require your great help to get my brother into SAP House. He had done his FI/CO training and he is trying as fresher into SAP. So i request you to please give me interview questions on SAP FI/CO in topic wise. The reason i am asking here in this forum is, a lot of gurus who are having great experience are there in this group. if i get help from these gurus, that will be great help to my brother into get into SAP FI/CO.
    So i request you to please send me interview questions on SAP FI and CO in topic wise. Awaiting for your reply.
    Regards
    Raj

    Hi,
    Please find below few questions on FI. I think those are very useful for intervew
    SAF FI Technical Interview Questions 1
    1. Tell me about FI Organizational structure?
    Ans:     Client
                   |
          Operating Concern
                   |
    Controlling area1       Controlling Area 2
             |
    Co. Code 1 Co. Code 2
        |
    Bus area 1  Bus area2  Bus Area3  Bus Area 4
    2. How many Normal and Special periods will be there in fiscal year, why do u use special periods?
    Ans: 12 Normal posting period and 4 special periods are in the fiscal year which can be used for posting tax and audit adjustments to a closed fiscal year.
    3.Where do you open and close periods?
    Ans: PPV is used to open and close the periods based on a/c types considering GL Accounts. Tr. Code. OB52.
    4.What do you enter in Company code Global settings?
    Ans: 4 digit Alphanumeric key.
    Name of the company
    City
    Country
    Currency
    Language
    Address
    5.What is document type, and what does it control? Examples.
    Ans: Document type is nothing vouchers containing line items. Several business transac! tions can be identified within a particular document type.
    It controls the document number ranges.
    It controls the Header part of document
    IT controls the line item level of the document
    Helps filing of physical document 
    6. What is posting key and what does it control?
    Ans: These are special classification keys. Two character numerical key it controls the entry of line items.
    Posting key determines Account type, Debit/credit posting, Field status of transaction.
    7. What is field status group, what does it control? 
    Ans: FSG is mandatory field in ! GL Creation. You use this field to define which fields are displayed when you post business transactions to a G/L account. 
    A field may have one of the following statuses.
    - Suppressed
    - Display
    - Optional
    - Required
    8. What is chart of account and how many charts of accounts can be assigned to a company?
    Ans: Chart of account is a list of all G/L accounts used by one or several company codes.
    For each G/L account, the chart of accounts contains the account number, account name, and the information that controls how an account functions and how a G/L account is created in a Company code.
    You have to assign a chart of accounts to each company code. This chart of accounts is the Operating chart of accounts and is used for the daily postings in this company code.
    You have the following options when using multiple company codes.
    You can use the same chart of accounts for all company codes
    If the company codes all have the same requirements for the chart of accounts set up, assign all of the individual company codes to the same chart of accounts. This could be the case if all company codes are in the same country.
    In addition to the operating chart of accounts, you can use two additional charts of accounts If the individual company codes need different charts of accounts, you can assign up to two charts of accounts in addition to the operating chart of accounts. This could be the case if company codes lie in multiple countries.
    The use of different charts of accounts has no effect on the balance sheet and profit and loss statement. When creating the balance sheet or the profit and loss statement, you can choose whether to balance the co! mpany codes which use different charts of accounts together or separately.
    9. What does definition of a chart of account contains?
    Ans: chart of account key
    Name
    Maintenance language
    Length of the GL Account Number
    Controlling Integration
    Group chart of accounts (Consolidation)
    Block Indicator
    10. Can one COA be assigned to several companies?
    Ans: yes. One COA can be assigned to several companies.
    11) What is account group and what does it control? 
    Ans: Account group determines which fields you can configure on the G/L master record. It is necessary to have at least two one for B/S and another one for P&L a/c.
    It controls the Number ranges of GL A/C.
    The status of fields of the master record of GL belongs to company code area.
    12) What is reconciliation account; can you directly enter documents in that a/c?
    Ans: When you p! ost items to a subsidiary ledger, the system automatically posts the same data to the general ledger. Each subsidiary ledger has one or more reconciliation accounts in the general ledger. 
    We can’t use reconciliation account for direct postings.
    13) How do you control field status of GL master records and from where do you control! 
    Ans: Field status variant is maintained all FSGs.
    14) What are the segments of GL master record?
    Ans:
    - COA Segment
    A/C group
    Nature of account
    Short text
    GL a/c long text
    Trading partner
    Group Account Number
    -  Company code segment
    Account currency
    Tax
    Reconciliation a/c for a/c type
    OIM,LID,FSG.
    15) What does Field status group assigned to a GL master record controls?
    Ans: It controls the account assignments that are made to the account. Specifically the field status group controls whether postings to cost centers, internal orders, profitability segments and so on are required, not allowed (suppressed), or optional.
    16) What is Country and operational chart of account? Why do you use group chart of account?
    Ans: Operational chart of account – Day to day activities It is mandatory.
    Country COA – It’s used for legal specific requirement of each country. It’s additional and optional.
    Group COA used for consolidation of Company codes. This is for group consolidation purpose.
    17) What are all the segments in a Customer/Vendor master record?
    Ans: Segments in Customer           Segments in Vendor
    -      General Data segment            General data segment
    -      Company code segment         Company code segment
    -      Sales area segment                 Purchasing organization Segment
    18) What is open line item management? What do you mean by clearing open line items?
    Ans: Open item management is further reconciliation function. OIM allows you to display the open and cleared items and amounts in an account. OIM should be used if an offsetting entry is made for every line item posted in the account. The a/c is reconciled and cleared against another account. Ex. Salary clearing account and GR/IR Clearing account.
    19) What is residual payment and part payment?
    Ans: Residual payment it clears original invoice with incoming amount and create new line item for remaining outstanding amount.
    Partial payment it leaves the original invoice amount and creates new
    line item for incoming amount.
    20) What is internal and external number ranges?
    Ans: Internal Number Ranges: Doc. No will be provided by the system automatically in serial order allotting the next available progressive number. The number must be in numerical.
    External Number ranges: Doc. No will be given manually by the end user. System will not lock no automatically in this case. User can pick the number randomly. Number may be an alpha numeric.

  • Please give me idea now I compile all branch data in head office only new r

    Hi master
    Sir I have 5 office In different city and one head office in Karachi all branch have same oracle system my question is how I get new data and compile for accumulative reporting
    I want only new record and modify record not old record
    Old record already I import
    When I use oracle import and export tool that no give me right result
    If xxx table exists in database then import tool not replace and no insert or no replace with previous data with new modify data
    Such as
    First time
    V_no=897 have debit amount 3998 is Islamabad branch and i export form Islamabad and import in Karachi office
    Next time
    Islamabad office change v_no=897 debit amount with 76555 and add many new record
    I export form Islamabad and import in Karachi office but system no change and not add new record in Karachi office
    Please give me idea now I compile all branch data in head office only new record and modify record
    Thanks
    aamir

    Here a very simple example with table EMP, assuming source table has a primary key. Firstly you create a materialized view log on source table (necessary for fast refresh) :
    SYS@db102 SQL> conn test/test
    Connected.
    TEST@db102 SQL> create materialized view log on emp including new values;
    Materialized view log created.
    TEST@db102 SQL> then at destination DB/user :
    TEST@db102 SQL> conn scott/tiger@test10
    Connected.
    SCOTT@test10 SQL> create database link test
      2  connect to test identified by test
      3  using 'db102';
    Database link created.
    SCOTT@test10 SQL> create materialized view emp_mv
      2  refresh fast
      3  as select * from emp@test;
    Materialized view created.
    SCOTT@test10 SQL>Now emp_mv is the exact copy of emp. To refresh the MV, to reflect changes :
    SCOTT@test10 SQL> exec dbms_mview.refresh('EMP_MV','F');
    PL/SQL procedure successfully completed.
    SCOTT@test10 SQL>                                                                  ...but I strongly recommend you to read the documentation...

Maybe you are looking for