About 49,300 results
Open links in new tab
  1. How to Print Multiple Variables in Java - Java2Blog

    Nov 26, 2023 · Printing multiple variables in Java can be achieved through various methods, each suited to different use cases. Simple concatenation with the + operator is easy and straightforward for a small number of variables.

  2. How to print multiple variable lines in Java - Stack Overflow

    May 11, 2014 · I'm trying to print the test data used in webdriver test inside a print line in Java. I need to print multiple variables used in a class inside a system.out.print function (printf/println/whatever).

  3. java - How can I print this 2 Variables in the same println

    Apr 12, 2017 · use a + sign and not a comma System.out.println(abdou1+" "+ abdou2); If the two variables are a double and an int (as stated in the question), that would print the sum of those two values, not both variables. you should use "+" operator.

  4. Java Print/Display Variables - W3Schools

    Display Variables. The println() method is often used to display variables. To combine both text and a variable, use the + character:

  5. java - Adding multiple Variables on println - Stack Overflow

    Apr 16, 2014 · You do it the same exact way you are inserting your result variables into the strings... System.out.println(operand1 + " + " + operand2 + " = " + sum); You could also use printf if you wanted to although you have to insert the line break explicitly:

  6. Print Single and Multiple Variables in Java - Online Tutorials …

    Jul 14, 2020 · Learn how to print single and multiple variables in Java with examples. Understand different methods to display variable values effectively.

  7. How to Print Multiple Lines of Variables in Java

    In Java, you can print multiple lines of variable values using `System.out.println()` or `System.out.printf()`. Different approaches allow for flexible formatting and readability in your output.

  8. Java Declare Multiple Variables - W3Schools

    To declare more than one variable of the same type, you can use a comma-separated list: Instead of writing: You can simply write: Try it Yourself » You can also assign the same value to multiple variables in one line: Try it Yourself »

  9. Java Output Values / Print Text - W3Schools

    You learned from the previous chapter that you can use the println() method to output values or print text in Java: System.out.println("Hello World!"); You can add as many println() methods as you want. Note that it will add a new line for each method: System.out.println("Hello World!"); System.out.println("I am learning Java.");

  10. java - Print multiple char variables in one line? - Stack Overflow

    Oct 3, 2013 · I'd use a StringBuilder over the awkward String concatenation (just a preference), but +1 for the printf answer. You can use one of the String constructors, to build a string from an array of chars. The println() method you invoked is one that accepts an int argument.

  11. Some results have been removed
Refresh