About 1,010,000 results
Open links in new tab
  1. Java Program to Find Square of a Number - Tutorial Gateway

    Write a Java Program to find Square of a Number using methods with example. Java Program to Find Square of a Number Example 1. This Java program allows the user to enter an integer …

  2. How to Square a Number in Java: A Step-by-Step Guide - Code …

    Feb 11, 2024 · This Java program is designed to demonstrate how to square a number using a simple, clean method. The architecture of the code includes two main sections: the main …

  3. java - Method to return square of a number - Stack Overflow

    There isn't a print statement in Java - you need to use the method System.out.println(square(num)); Although, actually, your square method is writing the …

  4. How to Square a Number in Java? - JavaBeat

    Dec 30, 2023 · Three different methods in Java are used for taking a square. These methods include multiplying the number with itself, by using the functions, or by using the BigInteger …

  5. Java: How to square a number - alvinalexander.com

    Jul 30, 2024 · Solution 1) Java: Square a number by multiplying it by itself; Solution 2) Java: Square a number with the Math.pow method; More Java power multipliers

  6. Calculating and Displaying the Square of an Integer in Java

    Mar 26, 2025 · The task is to create a static method in Java called printSquare that calculates the square of a given integer and prints it to the console. By using the hard-coded value 5, the …

  7. Java - How to find Square of a Number - Techndeck

    Jul 22, 2020 · java.lang.math class provides a method Math.pow () to get the square of a number. Like below: Square = Math.pow (number,2); Note: number is the first argument for which we …

  8. Java program to find square of a number - tutorialsinhand

    Lets learn to write a java program to find square of a number provided by user. Lets see the process of finding square of number. Suppose, number = 5, its square is 5*5 = 25. number = …

  9. Java Program to Calculate Square of number - Quescol

    Jun 4, 2022 · In this program we are using Java 8 streams to calculate the square of a number. The DoubleStream.of(num).map(x -> x * x) expression is used here to find square of a given …

  10. Java program for calculating square of a number - Students …

    Java program for calculating square using method. import java.util.Scanner; public class SquareNum { public static void main(String [] args) { Scanner sc = new Scanner(System.in); …

Refresh