#shorthand for appending values to a array

1 messages · Page 1 of 1 (latest)

strong jasperBOT
#

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

strong jasperBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

fickle haven
#
import java.util.Scanner;

public class class3 {
   static Scanner input = new Scanner(System.in);
   class2[] objects = new class2[10];
        public void add2(class2 e) {

        }
        public class2 add() {
            System.out.println("name    : ");
            String name = String.valueOf(input.nextLine());
                    System.out.println("id ");
                    int id = Integer.parseInt(input.nextLine());
            class2 e = new class2(name, id);
            return e;
        }

    }
strong jasperBOT
fickle haven
#

add2 should be adding the elements from add to objects

#

objects.add(e)