Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in

Posted on

Java Define an array of strings and add 3 new elements into the array

public class ArrayOfStrings {
    public static void main(String[] args) {
        String[] array = new String[3];
        array[0] = "Hello";
        array[1] = "World";
        array[2] = "!";
        System.out.println(array[0] + " " + array[1] + array[2]);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)