Search:

Type: Posts; User: thekbon

Search: Search took 0.20 seconds.

  1. Re: Problem with calling objects from same-class methods in main

    import java.util.*;
    import java.io.*;
    import java.lang.*;
    public class AnimalCrossingTest
    {
    public static String name, town, temp;
    public static Scanner scan = new Scanner(System.in);...
  2. Re: Problem with calling objects from same-class methods in main

    Amber is just one of the 25 Fossil objects I need to make. (stego tail, stego torso, stego skull, trex tail, etc). In my Museum class, the addFossil method needs a string that adds to the array of...
  3. Re: Problem with calling objects from same-class methods in main

    Ah well, it was worth a shot. Thanks for the help though
  4. Re: Problem with calling objects from same-class methods in main

    Okay that clears a lot up for me. Like I said, I know I can create each and every Fossil object in main but do you know of a way to create all 25 of them that I need in one line of code? That was my...
  5. Re: Problem with calling objects from same-class methods in main

    Ah, okay I see. No, not directly.
    Here's how I have it set up:

    (main)
    Museum muse = new Museum();

    createFossils(); //<-- This is where amber is being defined. Unless this would be considered...
  6. Re: Problem with calling objects from same-class methods in main

    If by definitions for the symbols/variables you mean the initializing line (Fossil amber = new Fossil("Amber", 1200, false);) being the same as the constructor in the Fossil class, then yes. I'm...
  7. Problem with calling objects from same-class methods in main

    In my main class, I have a method that creates a list of Fossil objects. I put it into a separate method to make the overall code cleaner. In main, I am able to call the method createFossils()...
Results 1 to 7 of 7