<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/2zbl66gnk" -->

---
title: Java Cheat Sheet &amp; Quick Reference | daily.dev
description: This cheat sheet provides a quick reference for Java beginners, covering basic syntax, data types, string operations, arrays, conditionals, loops, and...
canonical: https://daily.dev/posts/2zbl66gnk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Java Cheat Sheet &amp; Quick Reference | daily.dev
og:description: This cheat sheet provides a quick reference for Java beginners, covering basic syntax, data types, string operations, arrays, conditionals, loops, and...
og:url: https://daily.dev/posts/2zbl66gnk
og:image: https://api.daily.dev/og/posts/2Zbl66GNk.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Cheat Sheet & Quick Reference

**[Just Java](https://daily.dev/sources/justjava)** · [@frankconnolly](https://daily.dev/frankconnolly) · 718 upvotes · 31 comments

## Summary

This cheat sheet provides a quick reference for Java beginners, covering basic syntax, data types, string operations, arrays, conditionals, loops, and collections. It includes code examples for compiling and running Java programs, variable declarations, manipulating strings, and using various control structures.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://quickref.me/java.html>

## Community discussion

Top comments from developers on daily.dev.

**@antonioesposito** · 9 upvotes

> for (int i = 0; i < 5; i++) {
>   if (i == 3) {
>     continue;
>   }
>   System.out.print(i);
> }
> // Outputs: 01245
>
> The output is 0124 not 01245 ;)

**@lorenzopaz** · 4 upvotes

> Thx for sharing with us @frankconnolly !

**@dellico** · 2 upvotes

> l was looking for something like this thank you!!

**@ifarra** · 2 upvotes

> thanks for sharing, that's very helpful

**@aumkarjagtap** · 2 upvotes

> That's really helpful!!

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/2zbl66gnk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/2zbl66gnk","headline":"Java Cheat Sheet & Quick Reference","text":"Shared: Java Cheat Sheet & Quick Reference","url":"https://daily.dev/posts/2zbl66gnk","datePublished":"2024-06-19T08:04:33.928Z","dateModified":"2024-08-30T02:19:31.326Z","author":{"@type":"Person","name":"Frank","url":"https://daily.dev/frankconnolly","image":"https://media.daily.dev/image/upload/s--JYGZgAVH--/f_auto/v1712778742/avatars/avatar_VjRDslGdLXSHXHEoFkIjA","description":"Developer ","worksFor":{"@type":"Organization","name":"FINEOS","logo":"https://media.daily.dev/image/upload/s--Y9CsFMNy--/f_auto/v1746790025/companies/fineos"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":6230}},"image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":718},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":31}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/64CvlDKMN"},"comment":[{"@type":"Comment","text":"for (int i = 0; i &lt; 5; i++) {\nif (i == 3) {\ncontinue;\n}\nSystem.out.print(i);\n}\n// Outputs: 01245\nThe output is 0124 not 01245 ;)","datePublished":"2024-08-03T20:02:38.298Z","url":"https://daily.dev/posts/2Zbl66GNk#c-bsFcdCQvL","author":{"@type":"Person","name":"Antonio Esposito","url":"https://daily.dev/antonioesposito","image":"https://lh3.googleusercontent.com/a/ACg8ocIy0OvYcXWdxMmqoEp2rvL1KXjNQVjs-1SAIJi9IbzBWikdANQ=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9}},{"@type":"Comment","text":"Thx for sharing with us @frankconnolly !","datePublished":"2024-07-14T03:25:08.933Z","url":"https://daily.dev/posts/2Zbl66GNk#c-edn9JsXqL","author":{"@type":"Person","name":"Lorenzo Pazin","url":"https://daily.dev/lorenzopaz","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"l was looking for something like this thank you!!","datePublished":"2024-08-13T17:01:28.512Z","url":"https://daily.dev/posts/2Zbl66GNk#c-ajFdAZilM","author":{"@type":"Person","name":"Dellico","url":"https://daily.dev/dellico","image":"https://media.daily.dev/image/upload/s--NycPOSai--/f_auto/v1723568624/avatars/avatar_YiXpNIRxKQQMlS74WoqSG"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"thanks for sharing, that’s very helpful","datePublished":"2024-08-09T21:16:41.977Z","url":"https://daily.dev/posts/2Zbl66GNk#c-V8oT4cy0h","author":{"@type":"Person","name":"Ifarra","url":"https://daily.dev/ifarra","image":"https://avatars.githubusercontent.com/u/125471579?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"That’s really helpful!!","datePublished":"2024-08-12T02:18:15.173Z","url":"https://daily.dev/posts/2Zbl66GNk#c-chTz1zZBe","author":{"@type":"Person","name":"Aumkar Jagtap","url":"https://daily.dev/aumkarjagtap","image":"https://media.daily.dev/image/upload/s--zubEjXJs--/f_auto/v1755838751/avatars/avatar_SpPWKgyuqSWrHjEnczS5D?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/justjava","name":"Just Java"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Just Java","item":"https://daily.dev/squads/justjava"},{"@type":"ListItem","position":3,"name":"Java Cheat Sheet & Quick Reference"}]}
```

