# Java program to find the area of a square

A square is a rectangle whose length and breadth are same. Therefore, Area of a rectangle is the square of its length. so, to calculate the area of a square

• Get the length of the square form the user.
• Calculate its square.
• Print the square.

## Example

import java.util.Scanner;
public class AreaOfSquare {
public static void main(String args[]){
int length, area;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the length of the square ::");
length = sc.nextInt();
area = length* length;
System.out.println("Area of the square is ::"+area);
}
}

## Output

Enter the length of the square ::
55
Area of the square is ::3025
{"ft_lang_label":"__label__en","ft_lang_prob":0.7915201,"math_prob":0.9941193,"size":1974,"snap":"2022-40-2023-06","text_gpt3_token_len":492,"char_repetition_ratio":0.21725889,"word_repetition_ratio":0.14092141,"special_character_ratio":0.25582573,"punctuation_ratio":0.0952381,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9975899,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-03T00:48:31Z\",\"WARC-Record-ID\":\"<urn:uuid:b2606de9-4e5a-4e03-93ca-35b29d4dc378>\",\"Content-Length\":\"41660\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:af279552-1ba8-4d5a-80ad-24c0f2334152>\",\"WARC-Concurrent-To\":\"<urn:uuid:9736e4e6-3ae7-42b7-884f-e458b50cfdce>\",\"WARC-IP-Address\":\"192.229.210.176\",\"WARC-Target-URI\":\"https://www.tutorialspoint.com/Java-program-to-find-the-area-of-a-square\",\"WARC-Payload-Digest\":\"sha1:BINL3UKEJXROF3OYQHSSTEVWITBU6E5I\",\"WARC-Block-Digest\":\"sha1:VYJBJXECXGODE3AHJ4NXJ7W3NGERKIEH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500041.2_warc_CC-MAIN-20230202232251-20230203022251-00631.warc.gz\"}"}