public class Program {
public static void main(String[] args){
int[] numbers = new int[10];
for (int i = 0; i < 10; i++) {
numbers[i]=i+1;
}
for (int i : numbers) {
System.out.println(i);
}
}
}
More Related Contents:
- How do I get the last character, then last two so on.. of a string?
- Where I should start coding app pc or android? [closed]
- Why does the if statement “if(1)” give error in Java but it holds true in C++?
- How to Map two List Of type String in third List of Object [closed]
- Is List a subclass of List? Why are Java generics not implicitly polymorphic?
- What is the difference between Class.getResource() and ClassLoader.getResource()?
- Java order of Initialization and Instantiation
- Why are local variables not initialized in Java?
- Avoid Jackson serialization on non fetched lazy objects
- Instantiating generics type in java
- Singleton class with several different classloaders
- How to fix ambiguous type on method reference (toString of an Integer)?
- Automatically resize Canvas to fill the enclosing Parent
- How to find the JVM version from a program?
- Android : How to read file in bytes?
- How do I initialize a byte array in Java?
- How to pass console arguments to application in eclipse?
- Could not find or load main class
- Why is System.nanoTime() way slower (in performance) than System.currentTimeMillis()?
- Java concurrency: Countdown latch vs Cyclic barrier
- Distributed sequence number generation?
- Convert text content to Image
- When does a Java Thread reach the ‘Die’ State
- How can I convert a char to int in Java? [duplicate]
- Tomcat: How to find out running Tomcat version?
- list all files from directories and subdirectories in Java
- Persisting UUID in PostgreSQL using JPA
- How to speed up unzipping time in Java / Android?
- Does collect operation on Stream close the stream and underlying resources?
- PKCS12 Java Keystore from CA and User certificate in java