Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6057069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:26:51+00:00 2026-05-23T08:26:51+00:00

I have a Project class and I want that to hold projects that I

  • 0

I have a Project class and I want that to hold projects that I want to be doing. I’m a jewelry and want to essentially have a file from each project I have going on. Each file has, right now, a name, date started, deadline date, and description. I want to call the printPro() I just don’t know how.

The Project class looks like this:

public class Project {
    String name;
    int date;//start date
    int fDate;//finish date
    String description;

    public Project(String gName, int gDate, int gFDate, String gDescription){
        // mean they are the ones that are given.
    }
    public void receivedName(String receivedName) {
        name= receivedName;
    }
    public void receivedDate(int receivedDate) {
    date= receivedDate;
    }
    public void receivedFDate(int receivedDate) {
    fDate= receivedDate;
    }


    public String returnName(){
    return name;
    }
    public int returnDate(){
    return date;
    }
    public int returnFDate(){
    return fDate;
    }
    public String returnDescription(){
    return description;
    }

    public String printPro(int index){
    String tempString = ("Project Name: " + name + 
            "\nStart Date: " + date +
            "\nFinish Date: " + fDate + "\nDescription: " +     description);
        return tempString;
    }

    public void printProject(int index){

    System.out.println("Project Name: " + name + 
            "\nStart Date: " + date +
            "\nFinish Date: " + fDate + "\nDescription: " +     description);
        }

    }

Right now all I have is everything running though a console. I was going to build a Window later when I learn how to create and import a text file. Anyway here is the code for the console:

public class Top{
    Math help = new Math();//Creates a Math object
    People person = new People();//Creates a People object
//  Project nProject= new Project(); 
    ArrayList<Project> mProject = new ArrayList<Project>();
    Project[] storeProject; //Tried to create an array of Projects I could just add to. 
    Project[] storeTempProject;
    StringTest sTest = new StringTest(); // This is my class to use the console.
    String choice; //Temporary strings
    String redo;

public static void main (String [] args){
//  ============Project Menu =========================
private void project() {
    System.out.println("ADD, DELETE, REVIEW, or BACK?");
    sTest.stringReader();
    choice = sTest.getString();

    if (sTest.test(choice, "add")){
        System.out.println("What would you like to call this project?");    
        sTest.stringReader();
        String name = sTest.getString();

        System.out.println("When would you like it to start?");
        sTest.stringReader();
        String startDate = sTest.getString();
        int sDate = Integer.parseInt(startDate);

        System.out.println("When would you like it to end?");
        sTest.stringReader();
        String finishDate = sTest.getString();
        int fDate = Integer.parseInt(finishDate);

        System.out.println("What is the description of your project?");
        sTest.stringReader();
        String projectDescription = sTest.getString();

        mProject.add(new Project(name, sDate, fDate, projectDescription));
    }
}

I took out some unnecessary stuff out of my code so it doesn’t bog down this question. If you need more info let me know. I have been searching for an hour now so I’m assuming this doesn’t work and I need to do it another way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:26:51+00:00Added an answer on May 23, 2026 at 8:26 am

    I’m not entirely sure on your question, but maybe this what you are after:

    You can call methods on the elements of your ArrayList like this:

    for (Project proj : mProject) {
        proj.printPro();
    }
    

    To display the first one just do:

    mProject.get(0) 
    

    Will return the first Project in the ArrayList. To return second just change the argument to ‘get’ to 1. You should be able to work out how to get the rest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a projects resource that has many tasks. I want to ensure that
I my project I have a class that in this class I want to
I my project I have a class that in this class I want to
I have a specific class in my project that used for load and hold
I have an Integer rankOnHighlights property in my Project domain class. I want to
I have a static class in a shared project, which I want to extend
I currently have the following models/toy.rb file in my RoR project: class ToysPurchased include
I have a rails project where project model has many issues. class Project <
I have a 'project' model. Each project has a 'gallery' and each gallery has
In a proof-of-concept project I'm working on, I have a generic abstract class that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.