Example usage for java.util Arrays toString

List of usage examples for java.util Arrays toString

Introduction

In this page you can find the example usage for java.util Arrays toString.

Prototype

public static String toString(Object[] a) 

Source Link

Document

Returns a string representation of the contents of the specified array.

Usage

From source file:Main.java

public static void main(String[] args) {
    int[] numbers = readNumsFromCommandLine();
    System.out.println(Arrays.toString(numbers));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);/*from www.  ja va  2  s .  c o m*/

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();

    String[] keywords = dbmd.getSQLKeywords().split(",\\s*");
    Arrays.toString(keywords);
}

From source file:Main.java

public static void main(String[] args) {
    ResourceBundle bundle = ResourceBundle.getBundle("hello", Locale.US);
    Enumeration<String> keys = bundle.getKeys();
    ArrayList<String> temp = new ArrayList<String>();

    for (Enumeration<String> e = keys; keys.hasMoreElements();) {
        String key = e.nextElement();
        if (key.startsWith("java2s")) {
            temp.add(key);/*from   w w w .j  a  v a  2 s  . c  o m*/
        }
    }

    String[] result = new String[temp.size()];

    for (int i = 0; i < temp.size(); i++) {
        result[i] = bundle.getString(temp.get(i));
    }
    System.out.println(Arrays.toString(result));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);//from  www  .j av a2 s . c  o  m

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();
    // Get the list of string functions
    String[] stringFunctions = dbmd.getStringFunctions().split(",\\s*");
    Arrays.toString(stringFunctions);

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);//w  ww  . ja va 2  s. co m

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();
    // Get the list of system functions
    String[] systemFunctions = dbmd.getSystemFunctions().split(",\\s*");
    Arrays.toString(systemFunctions);

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);//from  w ww . j  a  v  a2 s.  com

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();
    // Get the list of numeric functions
    String[] numericFunctions = dbmd.getNumericFunctions().split(",\\s*");
    Arrays.toString(numericFunctions);

}

From source file:Main.java

public static void main(String[] args) {
    MyObject a1 = new MyObject("a", 1);
    MyObject a2 = new MyObject("a", 2);
    MyObject a3 = new MyObject("a", 3);
    MyObject b1 = new MyObject("b", 1);
    MyObject b2 = new MyObject("b", 2);
    MyObject b2a = new MyObject("b", 2);
    MyObject nullLevel = new MyObject("a", null);
    MyObject nullName = new MyObject(null, 2);
    SortedSet<MyObject> set = new TreeSet<MyObject>();
    set.add(a1);//from  w ww. j  av  a2s  .  c  o  m
    set.add(a2);
    set.add(a3);
    set.add(b1);
    set.add(b2);
    set.add(b2a);
    set.add(nullLevel);
    set.add(nullName);
    System.out.println(Arrays.toString(set.toArray()));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);/*www .  j  a v a2s.c o m*/

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();

    // Get the list of time and date functions
    String timedateFunctions[] = dbmd.getTimeDateFunctions().split(",\\s*");
    Arrays.toString(timedateFunctions);

}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Arrays.toString(divide(12, 5)));
}

From source file:br.upf.contatos.tcp.Client.java

public static void main(String[] args) throws RuntimeException {

    String teste = Arrays.toString(args);
    if (args.length == 0) {
        Client.HOST = "localhost";
    } else {// w ww  .j a  va  2  s  .c  om
        Client.HOST = args[0];
    }

    ClientConnector tcpService = new ClientConnector(Client.HOST, PORTA);
    String line;
    tcpService.connect();
    do {
        System.out.println("Digite help, para o menu");
        Scanner scanner = new Scanner(System.in);
        line = scanner.nextLine();
    } while (comando(line, tcpService));

    tcpService.disconnect();
}