I am trying to concatenate strings in Java. Why isn\'t this working?
public class StackOverflowTest {
public static void main(String args[]) {
The concatenation operator in java is +
, not .
Read this (including all subsections) before you start. Try to stop thinking the php way ;)
To broaden your view on using strings in Java - the +
operator for strings is actually transformed (by the compiler) into something similar to:
new StringBuilder().append("firstString").append("secondString").toString()