How about something like the following to get you going …
double x = 20;
double root = Math.sqrt(x);
int t = (int)root;
System.out.println("Root is:" + root + " and answer is :" + t*t);
More Related Contents:
- Where can I find the source code for Java’s Square Root function? [closed]
- which programming language I should use between java and ruby for creating Android and iPhone app [closed]
- What is the difference between Java Garbage collection and C++ object destruction? [closed]
- Java – call void function that print my name
- Random shuffling of an array
- How do you make a deep copy of an object?
- How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?
- When to use: Java 8+ interface default method, vs. abstract method
- JRBeanCollectionDataSource: How to show data from the java.util.List from JavaBean?
- Why does a Java method reference with return type match the Consumer interface?
- What’s the difference between SoftReference and WeakReference in Java?
- Synchronization vs Lock
- How to combine paths in Java?
- Execute method on startup in Spring
- Why are local variables thread safe in Java
- Classpath does not work under linux
- Spring RestTemplate GET with parameters
- Peer not authenticated while importing Gradle project in eclipse
- JSON – Iterate through JSONArray
- calling setters from a constructor
- Lemmatization java [closed]
- Java Static Initialization Order [duplicate]
- Scanner only reads first word instead of line
- Apache poi Excel line chart points
- Can I use @Requestparam annotation for a Post request?
- Jersey Exception : SEVERE: A message body reader for Java class
- Default XML namespace, JDOM, and XPath
- Closest Ruby representation of a ‘private static final’ and ‘public static final’ class variable in Java?
- How to read well formed XML in Java, but skip the schema?
- JAXB and property ordering