import java.util.Scanner; /** * Replace this JavaDoc comment for the purpose of this class */ class Solution { /** * Gets data from standard input */ private Scanner input; /** * Start the execution of the solution * @param args Command line arguments */ public static void main(String args[]) { Solution solution = new Solution(); solution.run(); } /** * Run the solution. This method is called from main() */ public void run() { // Create object to read data from standard input input = new Scanner(System.in); String text = new String("algo"); if ( text == "algo" ) // text.equals("algo") == true System.out.println("son iguales"); else System.out.println("son diferentes!"); if ( 0.1 + 0.2 == 0.3 ) System.out.println("0.1 + 0.2 == 0.3"); else System.out.println("0.1 + 0.2 != 0.3!"); double mass = 1500.0; double validMass = mass > 1000.0 ? 1000.0 : mass; /* mass > 1000.0 ? System.out.println("invalid data") : System.out.println("valid data"); // bmi = mass / h*h* */ int a = 5; int x = ++a - a--; System.out.printf("a=%d x=%d\n", a, x); // Close the standard input input.close(); } }