#Classes and List issues

1 messages · Page 1 of 1 (latest)

balmy cloak
#

HELP ME, HELP ME

unique relicBOT
#

<@&987246399047479336> please have a look, thanks.

limpid sage
#

ask a question ig

torn raven
#

Could you share more about what you are having issues with?

wide bridge
balmy cloak
#

OH MY GOD

#

@wide bridge@torn raven@limpid sage

#

I AM SO SORRY

#

MY BROTHER CAME IN AND POOED HIS PANTS

#

SO I COULDNT DO POST

#

I HAD TO RUSH HIM TO TOILET

limpid sage
#

bruh can you stop trolling?

balmy cloak
#

I SWEAR I AM NOT

#

Ok

#

so my question

limpid sage
#

this channel is for serious questions

limpid sage
balmy cloak
#

when i try to enter data in my list

limpid sage
#

at least writing in full caps is trolling

balmy cloak
#

from one class

balmy cloak
#

anyways

#

I have a method

#

for entering data

#

from one class, to another class's list

#

when i enter the data and print it, the data i entered appears

#

but

#

when I re call that method

#

and enter another data

#

the data that i entered previously

#

does not print

#

but only the new data that i entered

novel arch
#

It's hard for people to remark upon without any code, and please be aware that random remarks/poor post quality isn't the best way to get help.

wide bridge
#

balmy cloak
#

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Users {

public static void main(String[] args) {

    Users users = new Users();
    users.Registration();

}
List<String> Username = new ArrayList<>();





public void Registration(){

    Withdrawal_System Reg = new Withdrawal_System();
    Users user = new Users();
    System.out.println("To register your self, please enter your name");
    Scanner scanner = new Scanner(System.in);
    System.out.println(" ");
    user.Username.add(scanner.nextLine());
    System.out.println("your name has been registered");
    System.out.println(user.Username);
    System.out.println("What would like to do next");

    Reg.NewAction();

}

}

unique relicBOT
#

Please use this format for posting code:

```java
// Example java program
int value = 5;
System.out.println(value);
```

Which results in:

// Example java program
int value = 5;
System.out.println(value);

For syntax highlighting, you have to add the name of the language after the three backticks, like ```java. Please make sure to use exactly this format, so no space between the backticks and the language name, and a newline before the code starts. If done right, the syntax highlighting will even be applied to your text as you type, before sending.

balmy cloak
#

bruh my code is too long

#

how do i sned it

primal radish
#

drag drop the file

wide bridge
#

just focus on the suspected part behind the issue

#

we don't need to see all

balmy cloak
#

what file

wide bridge
#

what is the name of the method ?

#

and what is that Registration?

balmy cloak
#

ok here is a piece

#


        System.out.println(" ");
        System.out.println("1 | Book Options");
        System.out.println("2 | WithDrawal");
        System.out.println("3 | Return");
        System.out.println("4 | Register");
        System.out.println(" ");
        Scanner scanner = new Scanner(System.in);
        String answer = scanner.nextLine();


        if(answer.equals("1")){

            Option1();```
unique relicBOT
# balmy cloak ```public void NewAction(){ System.out.println(" "); System.ou...

Detected code, here are some useful tools:

Formatted code
public void NewAction() {
  System.out.println(" ");
  System.out.println("1 | Book Options");
  System.out.println("2 | WithDrawal");
  System.out.println("3 | Return");
  System.out.println("4 | Register");
  System.out.println(" ");
  Scanner scanner = new Scanner(System.in);
  String answer = scanner.nextLine();
  if (answer.equals("1")) {
    Option1();
balmy cloak
#

bruh

#

why is it so messed up

wide bridge
#

method names do not start with uppercase

balmy cloak
#

Im so dumb

#

i can just scrn shot

novel arch
#

You can drag and drop files here.

#

No screen shots, just drag and drop the file here.

balmy cloak
balmy cloak
#

DOne

novel arch
#

You don't do anything with your user, so it makes sense it does nothing. This was also code that could have been shared using the tag/dragged as a file. As others have remarked, kindly take others time and efforts into account.

gusty atlas
#

troll 101