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 8917885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:36:15+00:00 2026-06-15T05:36:15+00:00

I am writing a program that accepts names (strings) from a user using node

  • 0

I am writing a program that accepts names (strings) from a user using node data structures, displays the names, then selectively deletes the names. (I want the input to be in a array). When the names are entered using a for loop and displayed the the program will ask me what I want to delete or what name to remove from the array.

This is my class:

 public class Node
{
    Node next;
    String data;

    public Node (String data)
    {
        this.data = data;
    }
}

What the program should do:

Lets say I enter 5 names in a for loop.

Alex, George, Fryon, Storm, Hilbert.

Then when I entered it it will display:

Alex.
George
Fryon
Storm
Hilbert

Then it will ask what name should I delete?

(Alex)
George
Fryon
Storm
Hilbert

But I cant even enter them.

String[] contestant = new String [MAX];
head = null;

for (int i = 0; i <= 5; i++)
{ 
 System.out.println ("Enter a name:");
 name [0] = stdin.readLine ();

 node = new Node (name [i]);
 node.next = head;
 head = node;
}

And Im confused if nodes or linked lists relate to arrays. I was hoping to store it as a “node array”, use a for loop to display it “like an array” and then “delete it using sorting like an array”. But its honestly difficult.

  • 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-06-15T05:36:17+00:00Added an answer on June 15, 2026 at 5:36 am

    Write the following:

    String name;
    Node current = null;
    
    while(true)
    { 
     System.out.println ("Enter a name:");
     name = stdin.readLine ();
    
    if( name.equals("exit") ) break;
    
     if( current == null ) {
        current = new Node(name);
    }
    else {
       current.next = new Node(name);
       current = current.next;
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an autograder web application that accepts a program from the user as
I'm writing a program that lets the user input 6 temperature readings, and then
I am currently writing a program in Java that will accept strings from PHP
I am writing a program that accepts two ints within the program using nextInt();
I'm writing a C program that accepts input one line at a time from
I'm beginner to c++ and writing a program that accepts user choices and acts
I'm writing a program that's parsing an XML file to java objects using smooks.
I am writing a program that permutes a list of names based on a
I am writing a program that downloads images to the hard drive and then
I am writing a program in c++ that accepts a filename as an argument

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.