Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. for loop

Tag: for loop

java January 31, 2020 by mkyong 5 comments

Java – How to print a name 10 times?

This article shows you different ways to print a name ten times. 1. Looping 1.1 For loop JavaSample1.java package com.mkyong.samples; public class JavaSample1 { public static void main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("Java "); } } } Output Java Java Java Java Java Java Java Java Java […]

Read more Java – How to print a name 10 times?
kotlin April 12, 2018 by mkyong 3 comments

Kotlin – How to Loop a Map

In Kotlin, you can loop a Map via the following ways: 1. for loop val items = HashMap<String, Int>() items["A"] = 10 items["B"] = 20 for ((k, v) in items) { println("$k = $v") } 2. forEach items.forEach { k, v -> println("$k = $v") } 1. For Loop Loop a Map and filter it […]

Read more Kotlin – How to Loop a Map

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Maven Central
  • Docker Hub
  • Spring Guides
  • Quarkus Guides
  • Micronaut Guides
  • Martin Fowler
  • AskPython

© 2026 mkyong.com — Powered by WordPress

RSS