(Solved) Help in this code
//this is the code package com.randpkg.afsc; import java.util.Scanner; public class defaultiii { public static void rand (){ double randDouble = Math.random (); randDouble = randDouble * 100; int randInt = (int) randDouble; System.out.println("Did yiu had "+randInt+" in the test?"); } public static void main(String[] args) { String nop = "n" ; rand(); Scanner answer = new Scanner (System.in); String ans = answer.nextLine(); if (ans=="n") { rand (); }else { System.out.println("I knew it!"); }; } } /* Help me, this isn't working, why? * == random number (0/100) (OUTPUT): Did you had * in the test? (INPUT): n (OUTPUT): I knew it (END) i want to code this program for it try to ask if i had * in the test all the times i input 'n' https://code.sololearn.com/c50DaGd0vPij/?ref=app



