Skip to content

Instantly share code, notes, and snippets.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

import java.text.DecimalFormat;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Please enter in a number to find its square root value: ");
double x = in.nextDouble(); // User inputs a number to find the square root
// Prints the square value of the input and formats the input and output to two decimal places: