mycode的:
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendMailTLS {
public static void main(String[] args) {
final String username = "myemailid@gmail.com";
final String password = "myemailpassword";
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("myemailid@gmail.com"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("myfriedemail@ymail.com"));
message.setSubject("Testing Subject"); …Run Code Online (Sandbox Code Playgroud) 嗨,我认为我有三个数组变量a[dynamic], b[dynamic], c[dynamic].它们可以是任何大小,现在我想破坏变量说a.我相信我不会再使用变量了.欢迎任何想法和建议.
我有一个Integer数组value[].它可以是任何长度.
我需要找到最小的数字.我正在采访街道上的一个问题.我的时间超过,我收到错误.随着迭代变得更糟,我需要提高计算最小值的速度.
我对使用Java集合或其他任何东西感兴趣,所以任何人都会提出一些改进代码的建议.
int mini=value[0];
for (int i = 1; i < noinps; i++) {
if(mini>value[i]) {
mini=value[i];
}
}
System.out.println(mini);
Run Code Online (Sandbox Code Playgroud) java ×4
algorithm ×1
collections ×1
jakarta-mail ×1
jcombobox ×1
memory ×1
performance ×1
swing ×1