我的代码是:
// File Name SendEmail.java
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendEmail
{
public static void main(String [] args)
{
// Recipient's email ID needs to be mentioned.
String to = "toEmail@gmail.com";
// Sender's email ID needs to be mentioned
String from = "fromEmail@gmail.com";
// Assuming you are sending email from localhost
String host = "localhost";
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.setProperty("mail.smtp.host", host);
// Get the default Session object. …Run Code Online (Sandbox Code Playgroud) 有一些方法可以在java中生成随机数
其中之一是这样的:
Random rand=new Random();
int randomInteger=rand.nextInt();
Run Code Online (Sandbox Code Playgroud)
现在我的问题是:我们可以预测下一个随机数吗?
4个答案后编辑:
我真正的问题是:
我正在开发一个Snake Game(Linux中的半字节),我正在编程蛇移动,现在我想知道是否有可能预测苹果将出现的下一个地方.
可能吗?