class arraytablke {
public static void main(String[] args) {
System.out.println("Index \t Values");
int [] table= {3,4,67,4,5,888};
for (int i=0; i
class arraytablke {
public static void main(String[] args) {
System.out.println("Index \t Values");
int [] table= {3,4,67,4,5,888};
for (int i=0; i
Bumpo. Anybody know java here?
I'm not a Java programmer because Java is a shit language, however, from bottom reading up we can analyze the code
System.out.println([arguments]) --> this is the function which returns txt for the given arguments.
Analyzing the [arguments] we see i (integer for looping most likely) + "/t" (most likely a function handle which tells the System.out to operate over the list somehow, most likely the format command) + table[i] (calling the ith element from variable/areay "table")
We go up the list from there to see how the variable i and the areay table[i], work. In other words, what is table[i] input? Why would I want the ith element of table[i] and how is this modified by the function System.out?
no java programmer either
but println() may only print strings or only non-primitive integers
either convert to Integer(i) or String(i)
or 2nd option:
println(arg1 + arg2 + arg3) doesnt understand '+' . see documentation.
also:
for (int i=0; i
>java
This has never been funny.
>for (int i=0; i
println() only allows strings and primitives not a mix between then use i.toString() or if that Integer(i).toString().
completely wrong
>java
just learn C++ you monkey
>arraytablke
maybe write arraytable instead
Just keep the good work Mr President!
Highlight your code. If you are using Eclipse, click Source->Format. If you are not, find a way to format your code.
The mistake is super, super obvious when you have properly formatted code.
You have a weird semicolon after your for statement, before the opening parenthesis.
n00b
Good catch with the semi-colon.
What a stupid waste of carriage returns (having to use semicolons). VB is superior: for the mind. You C and Java guys merely want to make things look complicated to try and impress others. I could be biased. OK, I'm biased cause I code in vba. I do regret vba's missing x++.
Of course not compiling "x = iif(1=1,true,false)" into a faster If/else/end statement seems stupid. Or is there some potential flaw into compiling all these iif's into if/else/end statements? For readability and accuracy, it's better to have a single line assignment than 5 lines and having to repeat the x var twice. I prefer to see many lines of code at once and there is only so much real estate on a screen.
Epic
I have used VB as well and even VBA, but, just for your knowledge, VB is seen as being a retarded language (unless you are a programming war veteran with decades of experience).
In java, you can also use a ternary operation,
> x = 1 == 1 ? true : false;
Kys
/trash/ tier post
stfu
you instantiated your array incorrectly. it's supposed to be
int [] table = new int [] {...};
how the fuck didn't you catch that error? are you coding in notepad?
>It says "i cannot be resolved"
>"i cannot be resolved"
use a real compiler you fucking monkey
I've had this problem before. You need to reconfigure the values for the tables such that they can be read in iambic pentameter.
Three Four Sixty Seven Five Four Eighty
Eighty Eight
is a good start, but you need 7 more syllables.
This is the right answer. Get rid of the semicolon between the for loop and your curly brackets
You fucked up the syntax
>Javascript
semicolon after if(); shouldn't be there unless you don't want to run the body every loop iteration.
semicolon, faggot