“馬克社區(qū)”這個(gè)百度貼吧是一個(gè)叫“馬克-to-win”創(chuàng)建的,是一幫java初學(xué)者, java自學(xué)者, java新手,java菜鳥,java小白在里面學(xué)習(xí)討論交流的貼吧,集中了各種java初學(xué)者, 新手, 新人們的各種問(wèn)題,所謂各種亂, 他們樂(lè)在其中。順便提一句,這個(gè)貼吧是從屬于16個(gè)聲勢(shì)浩大的qq 群的, “java初學(xué)-馬克聯(lián)盟1”,“java初學(xué)-馬克聯(lián)盟2”,。?!癹ava初學(xué)-馬克聯(lián)盟16”。用關(guān)鍵字“java初學(xué)”查找qq群時(shí),頂冒了!
專注于為中小企業(yè)提供網(wǎng)站制作、網(wǎng)站設(shè)計(jì)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)江干免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了1000多家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
答題競(jìng)爭(zhēng)激烈, 哥們?cè)儋u把子力氣,
“馬克-to-win”自己是個(gè)java老炮,寫一些java網(wǎng)絡(luò)教材,包括安卓, jquery,spring架構(gòu), hadoop, 項(xiàng)目經(jīng)驗(yàn)什么的,頗受java剛?cè)胄械男⌒值軅兒迷u(píng),一大幫得意弟子已成java高級(jí)工程師,和張孝祥,馬士兵,畢向東,李剛, 孫鑫他們應(yīng)該有一拼!
比較出名的開源社區(qū)有哪些? IT程序員必逛的社區(qū),小編經(jīng)常去的一些國(guó)內(nèi)社區(qū)網(wǎng)站及論壇,關(guān)于程序員的交流社區(qū)或者論壇,這里收集一些比較好的開發(fā)者社區(qū)供大家參考,具體如下:
1、快速開發(fā)平臺(tái)社區(qū) -天翎論壇,主要是以Java低代碼開發(fā)平臺(tái)為主的技術(shù)性論壇社區(qū),目前低代碼平臺(tái)商用授權(quán)對(duì)外開放,即申請(qǐng)即用,無(wú)需等待;
2、CSDN -專業(yè)開發(fā)者社區(qū) IT技術(shù)交流平臺(tái);
3、IT圈,圈圈精彩 - 原軟媒論壇、IT之家,國(guó)內(nèi)最人氣的科技社交圈層,繼軟媒論壇、IT之家社區(qū)演變而來(lái);
4、51CTO技術(shù)論壇-中國(guó)領(lǐng)先的IT技術(shù)社區(qū) 國(guó)內(nèi)主流IT技術(shù)社區(qū),論壇擁有大批IT技術(shù)人/IT專家;
5、ITPUB技術(shù)論壇-中國(guó)專業(yè)的IT技術(shù)社區(qū)
import java.security.InvalidKeyException;import java.security.NoSuchAlgorithmException;import javax.crypto.BadPaddingException;import javax.crypto.Cipher;import javax.crypto.IllegalBlockSizeException;import javax.crypto.KeyGenerator;import javax.crypto.NoSuchPaddingException;import javax.crypto.SecretKey;public class JEncrytion{
public static void main(String[] argv) {
try{ KeyGenerator keygenerator = KeyGenerator.getInstance("DES"); SecretKey myDesKey = keygenerator.generateKey();
Cipher desCipher; // Create the cipher
desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
// Initialize the cipher for encryption
desCipher.init(Cipher.ENCRYPT_MODE, myDesKey); //sensitive information
byte[] text = "No body can see me".getBytes();
System.out.println("Text [Byte Format] : " + text);
System.out.println("Text : " + new String(text));
// Encrypt the text
byte[] textEncrypted = desCipher.doFinal(text);
System.out.println("Text Encryted : " + textEncrypted);
// Initialize the same cipher for decryption
desCipher.init(Cipher.DECRYPT_MODE, myDesKey); // Decrypt the text
byte[] textDecrypted = desCipher.doFinal(textEncrypted);
System.out.println("Text Decryted : " + new String(textDecrypted));
}catch(NoSuchAlgorithmException e){
e.printStackTrace();
}catch(NoSuchPaddingException e){
e.printStackTrace();
}catch(InvalidKeyException e){
e.printStackTrace();
}catch(IllegalBlockSizeException e){
e.printStackTrace();
}catch(BadPaddingException e){
e.printStackTrace();
}
}
}
使用txt文檔就可以編寫java源文件,只不過(guò)記得把擴(kuò)展名改為.java,我現(xiàn)在用的是MyEclipse8.5。就是這樣子的一個(gè)軟件。軟件是由代碼堆砌出來(lái)的(高手往往不這么認(rèn)為),簡(jiǎn)單說(shuō)你所碰到的所有軟件,包括網(wǎng)站都是從敲代碼開始的,希望對(duì)你有所幫助,不懂得地方繼續(xù)問(wèn)我。
1、Eclipse - IBM甩出來(lái)給開源社區(qū)的IDE,其本身就是使用Java開發(fā)的。\x0d\x0a2、MyEclipse - 把Eclipse包裝了一下,加了J2EE企業(yè)開發(fā)的許多功能強(qiáng)大的插件。\x0d\x0a3、NetBeans - SUN公司自己開發(fā)的Java開發(fā)環(huán)境,功能挺多的。\x0d\x0a4、還有一些超喜歡手工編寫Java代碼的牛人喜歡使用帶語(yǔ)法著色功能的純文本編輯器編寫Java程序,代碼寫完后在命令提示符下編譯運(yùn)行。這種方式只適用寫少量代碼或作為學(xué)習(xí)使用,開發(fā)大型項(xiàng)目不適用,因?yàn)樾屎艿汀?/p>
項(xiàng)目結(jié)構(gòu)如下:
代碼如下
package?main;
public?class?Course?{
private?String?classNum;
private?String?credit;
private?String?startClassDate;
private?String?endClassDate;
private?String?teacher;
private?String?assessment;
public?String?getClassNum()?{
return?classNum;
}
public?void?setClassNum(String?classNum)?{
this.classNum?=?classNum;
}
public?String?getCredit()?{
return?credit;
}
public?void?setCredit(String?credit)?{
this.credit?=?credit;
}
public?String?getStartClassDate()?{
return?startClassDate;
}
public?void?setStartClassDate(String?startClassDate)?{
this.startClassDate?=?startClassDate;
}
public?String?getEndClassDate()?{
return?endClassDate;
}
public?void?setEndClassDate(String?endClassDate)?{
this.endClassDate?=?endClassDate;
}
public?String?getTeacher()?{
return?teacher;
}
public?void?setTeacher(String?teacher)?{
this.teacher?=?teacher;
}
public?String?getAssessment()?{
return?assessment;
}
public?void?setAssessment(String?assessment)?{
this.assessment?=?assessment;
}
@Override
public?String?toString()?{
return?"?課程號(hào):"?+?classNum?+?",?學(xué)分:"?+?credit
+?",?上課時(shí)間:"?+?startClassDate?+?",?下課時(shí)間:"
+?endClassDate?+?",?教師:"?+?teacher?+?",??考核方式:"
+?assessment?+?"";
}
}
package?main;
import?java.io.BufferedInputStream;
import?java.io.BufferedReader;
import?java.io.File;
import?java.io.FileInputStream;
import?java.io.InputStreamReader;
import?java.math.BigDecimal;
import?java.util.ArrayList;
import?java.util.Arrays;
import?java.util.List;
import?java.util.Scanner;
public?class?Main?{
public?static?void?main(String[]?args)?throws?Exception?{
Scanner?sc?=?new?Scanner(System.in);???
System.out.println("創(chuàng)建學(xué)生請(qǐng)輸入姓名:");??
Student?stu1?=?new?Student();
stu1.setName(sc.nextLine());
Scanner?sc1?=?new?Scanner(System.in);???
System.out.println("創(chuàng)建學(xué)生請(qǐng)輸入學(xué)號(hào):");
stu1.setNumber(sc1.nextLine());
System.out.println("請(qǐng)選擇課程,課程如下:");
ListCourse?list2?=?new?ArrayListCourse();
stu1.setCourses(list2);
ListCourse?list?=?readTxt();
for?(Course?course?:?list)?{
System.out.println(course.toString());
}
for?(int?i?=?1;?i??5;?i++)?{
System.out.println("請(qǐng)輸入第"+i+"個(gè)課程號(hào):");
//輸入第一個(gè)課程號(hào)
list2?=?handleClass(list,?list2);
System.err.println("已選擇成功!");
list?=?notSelectClass(list,?list2);
System.out.println("請(qǐng)選擇課程,課程如下:");
if(i==4){
break;
}
for?(Course?course?:?list)?{
System.out.println(course.toString());
}
}
System.out.println("課程已選完!結(jié)果如下:");
System.err.println("學(xué)生:"+stu1.getName()+":");
for?(Course?course?:?list2)?{
System.err.println(course.toString());
}
}
/**
*?
*?查看未選擇可選課程
*?@param?list?全部可選課程
*?@param?list2?已選課程
*?@return
*/
private?static?ListCourse?notSelectClass(ListCourse?list,ListCourse?list2){
for?(int?i?=?0;?i??list.size();?i++)?{
for?(Course?course?:?list2)?{
//把已選課程剔除
if(course.getClassNum().equals(list.get(i).getClassNum())){
list.remove(i);
continue;
}
//把時(shí)間重合課程剔除??startdate1?=enddate2?and?enddate1=startdate2
if(daYuDengYu(course.getEndClassDate(),list.get(i).getStartClassDate())daYuDengYu(list.get(i).getEndClassDate(),?course.getStartClassDate())){
list.remove(i);
}
}
}
return?list;
}
public?static?boolean?daYuDengYu(String?first,?String?second){
BigDecimal?bd1?=?new?BigDecimal(first);
BigDecimal?bd2?=?new?BigDecimal(second);
return?bd1.compareTo(bd2)=0?true:false;
}
/**
*?處理選擇課程
*?@param?list
*?@param?list2
*?@return
*/
private?static?ListCourse?handleClass(ListCourse?list,ListCourse?list2){
while?(true)?{
Scanner?sssi?=?new?Scanner(System.in);
String?num?=?sssi.nextLine().trim();
for?(Course?course?:?list)?{
if(num.equals(course.getClassNum())){
list2.add(course);
return?list2;
}
}
System.out.println("課程號(hào)輸入錯(cuò)誤,請(qǐng)重新輸入:");
}
}
/**
*?讀取txt獲取課程??每個(gè)課程按;分割每個(gè)屬性按,分割
*?@return
*?@throws?Exception
*/
private?static?ListCourse?readTxt()?throws?Exception{
/*?讀入TXT文件?*/??
String?pathname?=?Main.class.getResource("/").toString();
pathname?=?pathname.substring(6,?pathname.length()-4)+"/src/classs/class.txt";?//獲取絕對(duì)路徑
File?filename?=?new?File(pathname);?//?要讀取以上路徑的txt文件??
ListCourse?list?=?new?ArrayListCourse();
BufferedInputStream?bis?=?new?BufferedInputStream(new?FileInputStream(filename));??
//讀取文件內(nèi)容??
byte[]?b?=?new?byte[bis.available()];??
bis.read(b);??
if(b!=null){
String?[]?strs=?new?String(b).split(";");
if?(strs==null)?{
return?null;
}
for?(String?string?:?strs)?{
String[]?str?=?string.split(",");
Course?course?=?new?Course();
course.setAssessment(str[5].trim());
course.setClassNum(str[0].trim());
course.setCredit(str[1].trim());
course.setEndClassDate(str[3].trim());
course.setStartClassDate(str[2].trim());
course.setTeacher(str[4].trim());
list.add(course);
}
}
bis.close();//關(guān)閉流(關(guān)閉bis就可以了)??
return?list;
}
}
package?main;
import?java.util.List;
public?class?Student?{
private?String?name;
private?String?number;
private?ListCourse?courses;
public?String?getName()?{
return?name;
}
public?void?setName(String?name)?{
this.name?=?name;
}
public?String?getNumber()?{
return?number;
}
public?void?setNumber(String?number)?{
this.number?=?number;
}
public?ListCourse?getCourses()?{
return?courses;
}
public?void?setCourses(ListCourse?courses)?{
this.courses?=?courses;
}
}
001,1,7,8,Joyce,assignment;
002,1,8,9,Joyce,assignment;
003,1,12,15,Joyce,assignment;
004,1,18,19,Joyce,assignment;
005,1,7,8,LI,assignment;
006,1,8,9,LI,assignment;
007,1,12,15,LI,assignment;
008,1,18,19,LI,assignment;