---
title: "Discussion on \"Using 2D arrays to randomly position \"ships\" in Battleships\" | Hashnode"
description: "Discussion on \"Using 2D arrays to randomly position \"ships\" in Battleships\". How to use Java's Random class for this without getting overlapping coordinates"
url: "https://hashnode.com/posts/using-2d-arrays-to-randomly-position-ships-in-battleships/63b6900b91ede34189469038"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Using 2D arrays to randomly position "ships" in Battleships](https://mimsydev.hashnode.dev/using-2d-arrays-to-randomly-position-ships-in-battleships?utm_source=hashnode&utm_medium=feed)

How to use Java's Random class for this without getting overlapping coordinates

Jan 5, 2023 · 3 min read · mimsydev.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#arrays](https://hashnode.com/tag/arrays)
-   [#2darray](https://hashnode.com/tag/2darray)

## Written by

[Miriam Smith](https://hashnode.com/@MimsyDev)

@MimsyDev

  
[View profile](https://hashnode.com/@MimsyDev)

Current Bachelor of Information Technology Student. Writing about all the mistakes I make so that you don't make the same ones!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
