Use Java Mail API to Send Email
private String smtpHost;
private String smtpUserName;
private String smtpPassword;
public void sendEmail(String fromAddress, List<String> toAddresses, List<String> ccAddresses,
String subject, String message) {
Properties props = new Properties();
props.put("mail.smtp.host", smtpHost);
session = Session.getDefaultInstance(props);
emailMsg = new MimeMessage(session);
emailMsg.setSubject( subject )
emailMsg.setfrom( new InternetAddress( fromAddress ) )
Transport transport = session.getTransport("smtp");
If smtpUserName is not null
transport.connect(smtpUserName, smtpPassword);
EndIf
Foreach toEmailAddress in toEmailAddresses
emailMsg.addRecipient(Message.RecipientType.TO, new InternetAddress( toEmailAddress ) );
EndFor
Foreach ccEmailAddress in ccEmailAddresses
emailMsg.addRecipient(Message.RecipientType.CC, new InternetAddress( ccEmailAddress ));
EndFor
emailMsg.setContent( message )
transport.sendMessage(emailMsg, emailMsg.getAllRecipients());
Call transport.close() to close the transport.
}
Ïà¹ØÎĵµ£º
java¹¹Ô캯Êý
ÆäÓï·¨¸ñʽÈçÏ£º
< modifiers> <class_name>([< argu_list>]) {[< statements>]}
×Ô¶¨Òå¹¹Ôì·½·¨£º·½·¨ÃûÓëÀàͬÃû£¬Ê××Öĸ´óд£¡Ã»Óзµ»ØÀàÐÍ¡£³ý´ËÖ®ÍâÆäËû¶¼¸úÆÕͨ·½·¨Ò»Ñù¡£
ĬÈϹ¹Ô캯Êý£ºÃ»ÓÐÐβÎûÓз½·¨Ì壡È磺public Person() {}
¶ÁÏÂÃæµÄÀý×Ó£¬Ìå ......
2009Äê7ÔÂÎҲμÓÁËÒ»¸öJAVAרҵ»ú¹¹µÄÅàѵ£¬Ö®ËùÒԲμÓÕâ¸öÅàѵ£¬ÎÒÊÇΪÁ˽øÒ»²½ÌáÉý×Ô¼ºµÄ¼¼Êõ£¬ÁíÒ»·½ÃæÎÒÒ²±È½Ïϲ»¶JAVA£¬Ï£ÍûËüÄܳÆΪÎҵļ¼ÊõÖ÷Á¦¡£×ªÑÛ£¬Åàѵ¾Í¿ì½áÊøÁË£¬ÐÄÖиÐÎòÁ¼¶à£¬Ï£ÍûÓë¾ý¹²Ãã¡£
ÎÒËù²Î¼ÓµÄÅàѵ»ú¹¹Ö»ÓÐÒ»¸öÀÏʦ£¬²»ÏñºÜ¶àµØ·½ÓкöàµÄÀÏʦ£¬Ã¿Ììÿһ½Ú¿Î¶¼ÊÇËûÀ´¸ ......
Êý×éÊôÒýÓÃÀàÐÍ£¬Êý×éÐÍÊý¾ÝÊǶÔÏó(object)£¬Êý×éÖеÄÿ¸öÔªËØÏ൱ÓڸöÔÏóµÄ³ÉÔ±±äÁ¿
Êý×éÖеÄÔªËØ¿ÉÒÔÊÇÈκÎÊý¾ÝÀàÐÍ£¬°üÀ¨»ù±¾ÀàÐͺÍÒýÓÃÀàÐÍ
¼ÇסÊý×éÊ×ÏÈ·ÖÅä¿Õ¼äÔÙ¸³Öµ£¡
¶¯Ì¬³õʼ»¯£º¾ÍÊÇÏÈ·ÖÅä¿Õ¼äÔÙ¸³³õÖµ£»
¾²Ì¬³õʼ»¯£º¶¨ÒåÊý×éͬʱ¾ÍΪÊý×éÔªËØ·ÖÅä¿Õ¼ä²¢¸³Öµ¡£
1һάÊý×éµÄÉùÃ÷
һάÊý×éµÄÉùÃ÷£ºtype va ......
Ç°ÌìÒ»¸çÃÇÎÊÎÒÒ»¸öСÎÊÌâÈçÏÂ
Java³ÌÐòÈçÏ£º
class yiwei
{
public static void main(String [] args)
{
int i = -4;
int c = i>>>1;
System.out.println(c);
......