answersLogoWhite

0

For(int I = 0: I < 5; i++)

{

System.out.println(" print this " + I );

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How can you print a table of 5 in java by getting values from user?

look at the print


How do you print a symbol in Java when multiple of 5 occurs?

if x%5==0 { System.out.println("@"'); }


How can you initialize an array in Java?

If you refering to Object then String[] something=new String[2]; Here you have to remember that something only allocated space for 2 String object but it did not created them yet. By default Objects are intantiated to null so if you try to print the content of an array System.out.println(something[0]);//print null System.out.println(something[0].toLowerCase()); Throws NullPointerException Couple other ways to create Arrays In java String[] something=new String[]{"Me","You"}; String[] something={"Me", "You"};


How can a staircase with n steps be implemented in Java?

A staircase with n steps can be implemented in Java using a loop to print the steps. Here is an example code snippet: java public class Staircase public static void main(String args) int n 5; // number of steps for (int i 1; i n; i) for (int j 1; j i; j) System.out.print(&quot;&quot;); System.out.println(); This code will print a staircase with 5 steps using &quot;&quot; symbols. You can adjust the value of n to change the number of steps in the staircase.


Which is the best way to convert numbers in string under java?

All of the Java number classes have a parse[type] method, like parseInt() in Integer or parseDouble() in Double that convert Strings to primitive numbers. String s = getInput(); int var = Integer.parseInt(s);


How do you write 55555 4444 333 22 1 in java?

To print the given sequence in Java, you can use a loop to iterate through each number and print it the corresponding number of times. Here's an example code snippet to achieve this: public class NumberSequence { public static void main(String[] args) { int[] numbers = {5, 4, 3, 2, 1}; for (int num : numbers) { for (int i = num; i &gt;= 1; i--) { System.out.print(num); } System.out.print(&quot; &quot;); } } } This code will output: 55555 4444 333 22 1


How do you play viva la vida on trumpet?

C# 5 times, then D# 5 times, then G# 4 times, and then, depending on which part of the song, it's F on the D string 5 times or F on the C string 5 times. Happy Viva la Viding!! ;-)


How do you convert an integer to a string?

That really depends on the programming language. In Java, it is sufficient to concatenate it with a String: int myNumber = 5; result = "" + myNumber; Other languages may require a special function, or method, to convert from integer to string.


What is the longest factor string of 15?

5 times 3


Printing 1111 2222 3333 4444 5555 this table using for loop from java?

public static void main(String[] args) { for(int i=1;i&lt;5;i++) { for(int j=1;j&lt;5;j++) { System.out.print(i); } System.out.println(); } }


Java code to print prime numbers from 1 to 10?

System.out.println("2, 3, 5, 7"); There are so few you dont need to calculate it


What isn't the longest factor string for 210?

The longest factor string for 210 is not simply the factors multiplied together in a straightforward manner, such as (2 \times 3 \times 5 \times 7). Instead, it can involve breaking down these factors into smaller integers that multiply to 210, like (1 \times 2 \times 3 \times 5 \times 7) or any combination of these factors that maintain the product of 210. Therefore, a string that doesn't maximize the count of factors, such as (1 \times 210), is not the longest factor string.