Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


My java code filter_list
Author
Message
RE: My java code #11
(02-28-2015, 05:40 AM)Strawberry Wrote: What was your reasoning behind creating the two strings "and" & "has" instead of just printing everything out like this?

System.out.println("Richest users are " +usernames[0][1] + "and" + usernames[1][1]);
System.out.println(usernames[0][1] + "has" + amount[0][0]);
System.out.println(usernames[1][1] + "has" + amount[0][1]);

It show as an error on netbeans when I did your way.
[Image: master645.png]

Life before death, strength before weakness, journey before destination.” ― The Way of Kings by Brandon Sanderson

Reply

RE: My java code #12
Attempting to compile the following code does not give me any errors.

Code:
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Sinister
{
    public static void main (String[] args) throws java.lang.Exception
    {
            String[][] usernames= {
           {"Blunt", "Eclipse", " Oni"},
          {"Tarew", " Master", " Lux"}
       };
                  
       String[][] amount= {
           {"86", "59", "46"}
       };
        
      System.out.println("Richest users are " +usernames[0][1] + " and " + usernames[1][1]);    
      System.out.println(usernames[0][1] + " has " + amount[0][0]);    
      System.out.println(usernames[1][1] + " has " + amount[0][1]);  
      }
    }

[+] 1 user Likes Strawberry's post
Reply







Users browsing this thread: 1 Guest(s)