oak barrel restaurant

Tue, 05 May 2026 14:36:10 +0000

Write a Java program to print first 10 odd natural numbers using for loop. package NumPrograms; public class First10OddNaturalNum1 { public static void main(String[] args) { System.out.println("The First 10. To learn the Java odd number program, you must have the basic knowledge of Java for loop and if statement. We can use different Java loops to display odd numbers: //Write a Java 8 program to print the first 10 odd numbers. Below are the steps: Create two threads T1 and T2 using the below syntax, where T1 and T2 are used to print odd and even numbers respectively. If the counter is even in the Thread T1, then wait.