Results 1 to 8 of 8
  1. #1
    LetsG0Blue is offline Member
    Join Date
    Feb 2013
    Posts
    68
    Rep Power
    0

    Default I have two programs and one needs to run through the other

    I have a Date.java and a dateArr.java

    how do I begin the count where the data begins in dateArr.java and runs through Date.java and returns to dateArr.java?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: I have two programs and one needs to run through the other

    Your question doesn't make sense (at least to me it doesn't); please rephrase. I've never seen data or code running 'through' something ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    LetsG0Blue is offline Member
    Join Date
    Feb 2013
    Posts
    68
    Rep Power
    0

    Default Re: I have two programs and one needs to run through the other

    Quote Originally Posted by JosAH View Post
    Your question doesn't make sense (at least to me it doesn't); please rephrase. I've never seen data or code running 'through' something ...

    kind regards,

    Jos
    I've figured it out. I had to run the dateArr class's information through the Date class, which is a separate program. Sorry for the confusion.

    Java Code:
    public class dateArr {
    
    	public static void main(String[] args) {
    
    		Date[] dateArr = new Date[4];
    		
    		dateArr [0] = new Date(5,16,1984);
    		dateArr [1] = new Date(11, 14, 1978);
    		dateArr [2] = new Date(7, 21, 1980);
    		dateArr [3] = new Date(7, 3, 1987);
    		
    		int index;
    				
    		for (index = 3; index + 1 > 0; index--)
                System.out.println(dateArr[index]); 
        }
    
    }

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,383
    Rep Power
    5

    Default Re: I have two programs and one needs to run through the other

    Don't use Date for this. Most of its methods (including the one you are using) are deprecated. Use the Calendar class instead.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: I have two programs and one needs to run through the other

    @OP: it is extremely dangerous to make up your own terminology; it may sound interesting to yourself or others who don't know what you're talking about to start with, but you make yourself misunderstood at best here in these forums where people roam around who do know what they're talking about. My tip: don't do it and supply enough detail and/or example code to make yourself clear and leave the buzz talk and other humbug to management.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    LetsG0Blue is offline Member
    Join Date
    Feb 2013
    Posts
    68
    Rep Power
    0

    Default Re: I have two programs and one needs to run through the other

    Quote Originally Posted by JosAH View Post
    @OP: it is extremely dangerous to make up your own terminology; it may sound interesting to yourself or others who don't know what you're talking about to start with, but you make yourself misunderstood at best here in these forums where people roam around who do know what they're talking about. My tip: don't do it and supply enough detail and/or example code to make yourself clear and leave the buzz talk and other humbug to management.

    kind regards,

    Jos
    What? I asked a question, but I'm new and not 100% sure about the terminology.

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: I have two programs and one needs to run through the other

    Quote Originally Posted by LetsG0Blue View Post
    What? I asked a question, but I'm new and not 100% sure about the terminology.
    It' ok not to be sure about accepted terminology but supply a bit of relevant detail instead. Your original question didn't make sense.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: I have two programs and one needs to run through the other

    Additionally, class names should start with an uppercase letter => Code Conventions for the Java Programming Language: Contents

    And while dateArr might be a viable name for a variable representing an array of dates, it doesn't make much sense as a class name.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Run Java Programs
    By StevenR in forum New To Java
    Replies: 2
    Last Post: 02-20-2013, 09:33 AM
  2. Greetings programs
    By neveser in forum Introductions
    Replies: 0
    Last Post: 12-03-2012, 07:24 AM
  3. Importing other programs
    By ajisfree in forum New To Java
    Replies: 1
    Last Post: 10-06-2012, 06:15 AM
  4. Please help fix error for two programs!
    By Asvin in forum New To Java
    Replies: 6
    Last Post: 10-13-2011, 11:59 PM
  5. Writing a programs
    By smray7 in forum New To Java
    Replies: 7
    Last Post: 04-28-2011, 07:49 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
  •