真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

java管理系統(tǒng)簡(jiǎn)單代碼 java管理系統(tǒng)源碼

求用Java編寫的學(xué)生成績(jī)管理系統(tǒng)的完整代碼,要能運(yùn)行的

以下方法實(shí)現(xiàn)了用戶界面登陸

成都創(chuàng)新互聯(lián)公司專注于沙灣網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供沙灣營(yíng)銷型網(wǎng)站建設(shè),沙灣網(wǎng)站制作、沙灣網(wǎng)頁(yè)設(shè)計(jì)、沙灣網(wǎng)站官網(wǎng)定制、小程序制作服務(wù),打造沙灣網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供沙灣網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。

import java.awt.*;

import java.awt.event.*;

public class DengLuJieMian extends Frame implements ActionListener

{

Label username=new Label("用戶名:");//使用文本創(chuàng)建一個(gè)用戶名標(biāo)簽

TextField t1=new TextField();//創(chuàng)建一個(gè)文本框?qū)ο?/p>

Label password=new Label("密碼:");//創(chuàng)建一個(gè)密碼標(biāo)簽

TextField t2=new TextField();

Button b1=new Button("登陸");//創(chuàng)建登陸按鈕

Button b2=new Button("取消");//創(chuàng)建取消按鈕

public DengLuJieMian()

{

this.setTitle("學(xué)生信息管理系統(tǒng)");//設(shè)置窗口標(biāo)題

this.setLayout(null);//設(shè)置窗口布局管理器

username.setBounds(50,40,60,20);//設(shè)置姓名標(biāo)簽的初始位置

this.add(username);// 將姓名標(biāo)簽組件添加到容器

t1.setBounds(120,40,80,20);// 設(shè)置文本框的初始位置

this.add(t1);// 將文本框組件添加到容器

password.setBounds(50,100,60,20);//密碼標(biāo)簽的初始位置

this.add(password);//將密碼標(biāo)簽組件添加到容器

t2.setBounds(120,100,80,20);//設(shè)置密碼標(biāo)簽的初始位置

this.add(t2);//將密碼標(biāo)簽組件添加到容器

b1.setBounds(50,150,60,20);//設(shè)置登陸按鈕的初始位置

this.add(b1);//將登陸按鈕組件添加到容器

b2.setBounds(120,150,60,20);//設(shè)置取消按鈕的初始位置

this.add(b2);// 將取消按鈕組件添加到容器

b1.addActionListener(this);//給登陸按鈕添加監(jiān)聽(tīng)器

b2.addActionListener(this);// 給取消按鈕添加監(jiān)聽(tīng)器

this.setVisible(true);//設(shè)置窗口的可見(jiàn)性

this.setSize(300,200);//設(shè)置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);

}

});//通過(guò)內(nèi)部類重寫關(guān)閉窗體的方法

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==b1)//處理登陸事件

{

String name=t1.getText();

String pass=t2.getText();

if(name!=nullpass.equals("000123"))//判斷語(yǔ)句

{

new StudentJieMian();

}

}

}

public static void main(String args[])//主函數(shù)

{

new DengLuJieMian();

}

}

以下方法實(shí)現(xiàn)了學(xué)生界面設(shè)計(jì)

import java.awt.*;

import java.awt.event.*;

class StudentJieMian extends Frame implements ActionListener

{

MenuBar m=new MenuBar();//創(chuàng)建菜單欄

Menu m1=new Menu("信息");//創(chuàng)建菜單“信息”

MenuItem m11=new MenuItem("插入");//創(chuàng)建“插入”的菜單項(xiàng)

MenuItem m12=new MenuItem("查詢");

Menu m2=new Menu("成績(jī)");//創(chuàng)建菜單“成績(jī)”

MenuItem m21=new MenuItem("查詢");

public StudentJieMian()

{

this.setTitle("學(xué)生界面");//設(shè)置窗口標(biāo)題

this.setLayout(new CardLayout());//設(shè)置窗口布局管理器

this.setMenuBar(m);//將菜單欄組件添加到容器

m.add(m1);//將信息菜單放入菜單欄

m.add(m2);

m1.add(m11);//將“插入”菜單項(xiàng)添加到“信息”菜單

m1.add(m12); //將“查詢”菜單項(xiàng)添加到“信息”菜單

m2.add(m21); //將“查詢”菜單項(xiàng)添加到“成績(jī)”菜單

m11.addActionListener(this); //給“插入”菜單項(xiàng)添加監(jiān)聽(tīng)器

m12.addActionListener(this); //給“查詢”菜單項(xiàng)添加監(jiān)聽(tīng)器

m21.addActionListener(this); //給“查詢”菜單項(xiàng)添加監(jiān)聽(tīng)器

this.setVisible(true); //設(shè)置窗口的可見(jiàn)性

this.setSize(300,200); //設(shè)置窗口的大小

addWindowListener(new WindowAdapter()

{

public void windowClosing(WindowEvent e)

{

System.exit(0);//關(guān)閉窗口

}

});

}

public void actionPerformed(ActionEvent e)

{

if(e.getSource()==m11) //處理“添加信息”事件

{

new AddStudent();

}

if(e.getSource()==m12) //處理“查詢信息”事件

{

new SelectStudent();

}

if(e.getSource()==m21) //處理“查詢成績(jī)”事件

{

new ChengJiStudent();

}

}

public static void main(String args[])

{ new StudentJieMian(); //創(chuàng)建一個(gè)對(duì)象 }

求一段簡(jiǎn)單的JAVA代碼 要求員工工資管理系統(tǒng)的一個(gè)增刪改查代碼,謝謝了

對(duì)數(shù)據(jù)庫(kù)進(jìn)行增刪改查?

以下是 sql server 2013+java.實(shí)現(xiàn)的是對(duì)MSC對(duì)象的增刪改查.

需要下載連接驅(qū)動(dòng)程序:com.microsoft.sqlserver.jdbc.SQLServerDriver

網(wǎng)上搜一下就行

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

class MSC

{

public String MscID;

public String MscName;

public String MscCompany;

public float MscLongitude;

public float MscLatitude;

public float MscAltitude;

public MSC(String MscID, String MscName, String MscCompany,

float MscLongitude, float MscLatitude,float MscAltitude){

this.MscID = MscID;

this.MscName = MscName;

this.MscCompany = MscCompany;

this.MscLongitude =MscLongitude;

this.MscLatitude = MscLatitude;

this.MscAltitude = MscAltitude;

}

}

public class sqlserverjdbc {

public Connection getConnection(){

String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //加載JDBC驅(qū)動(dòng)

String dbURL = "jdbc:sqlserver://localhost:1433; DatabaseName=gsm"; //連接服務(wù)器和數(shù)據(jù)庫(kù)sample

String userName = "sa"; //默認(rèn)用戶名

String userPwd = "123"; //密碼

Connection dbConn = null;

try {

Class.forName(driverName);

dbConn =DriverManager.getConnection(dbURL, userName, userPwd);

} catch (Exception e) {

e.printStackTrace();

}

return dbConn;

}

public void printUserInfo(){

Connection con = getConnection();

Statement sta = null;

ResultSet rs = null;

System.out.println("打印表格MSC信息");

try {

sta = con.createStatement();

rs = sta.executeQuery("select * from MSC信息");

System.out.println("MscID\tMscName\tMscCompany\tMscLongitude\tMscLatitude\tMscAltitude");

while(rs.next()){

System.out.println(rs.getString("MscID")+"\t"+

rs.getString("MscName")+"\t"+

rs.getString("MscCompany")+"\t"+

rs.getFloat("MscLongitude")+"\t"+

rs.getFloat("MscLatitude")+"\t"+

rs.getFloat("MscAltitude"));

}

con.close();

sta.close();

rs.close();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

System.out.println("打印完成\n");

}

public void delete(String MscID){

Connection con = getConnection();

String sql = "delete from MSC信息 where MscID = " + MscID;

PreparedStatement pst;

System.out.println("刪除表格MSC信息中 ID = "+MscID+"的記錄");

try {

pst = con.prepareStatement(sql);

pst.execute();

pst.close();

con.close();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("記錄刪除失?。。?!");

}

System.out.println("記錄刪除成功?。。n");

}

public void insert(MSC msc){

Connection con = getConnection();

String sql = "insert into MSC信息 values(?,?,?,?,?,?)";

PreparedStatement pst;

System.out.println("插入一條記錄");

try {

pst = con.prepareStatement(sql);

pst.setString(1, msc.MscID);

pst.setString(2, msc.MscName);

pst.setString(3, msc.MscCompany);

pst.setFloat(4, msc.MscLongitude);

pst.setFloat(5, msc.MscLatitude);

pst.setFloat(6, msc.MscAltitude);

pst.execute();

pst.close();

con.close();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("插入失?。。。?);

}

System.out.println("插入成功?。?!\n");

}

//更新MscID的MscName

public void updateMscName(String MscID, String MscName){

Connection con = getConnection();

String sql = "update MSC信息 set MscName = ? where MscID = ?";

PreparedStatement pst;

System.out.println("修改一條記錄");

try {

pst = con.prepareStatement(sql);

pst.setString(1, MscName);

pst.setString(2, MscID);

pst.execute();

pst.close();

con.close();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("修改失?。。?!");

}

System.out.println("修改成功?。?!\n");

}

public static void main(String args[]){

sqlserverjdbc sql = new sqlserverjdbc();

sql.printUserInfo();

sql.delete("1111");

sql.printUserInfo();

sql.updateMscName("5215", "聯(lián)想");

sql.printUserInfo();

sql.insert(new MSC("1111", "中興" ," 中興", (float)12.2, (float)3.4,(float)45.5));

sql.printUserInfo();

}

}

急求java學(xué)生信息管理系統(tǒng)源代碼,帶有連接數(shù)據(jù)庫(kù)的,萬(wàn)分感謝

import java.awt.BorderLayout;

import java.awt.CardLayout;

import java.awt.Container;

import java.awt.Font;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.Icon;

import javax.swing.ImageIcon;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JMenu;

import javax.swing.JMenuBar;

import javax.swing.JMenuItem;

import javax.swing.JPanel;

import javax.swing.JToolBar;

import javax.swing.SwingConstants;

public class MainFrame extends JFrame implements ActionListener{

InsertPanel ip = null;

SelectPanel sp = null;

JPanel pframe;

JButton jb1,jb2,jb3;

JMenuItem jm11,jm21,jm22,jm23,jm31,jm32,jm41,jm42;

CardLayout clayout;

public MainFrame(String s){

super(s);

JMenuBar mb = new JMenuBar();

this.setJMenuBar(mb);

JMenu m1 = new JMenu("系統(tǒng)");

JMenu m2 = new JMenu("基本信息");

JMenu m3 = new JMenu("成績(jī)");

JMenu m4 = new JMenu("獎(jiǎng)懲");

mb.add(m1);

mb.add(m2);

mb.add(m3);

mb.add(m4);

jm11 = new JMenuItem("退出系統(tǒng)");

jm21 = new JMenuItem("輸入");

jm22 = new JMenuItem("查詢");

jm23 = new JMenuItem("更改");

jm31 = new JMenuItem("輸入成績(jī)");

jm32 = new JMenuItem("查詢成績(jī)");

jm41 = new JMenuItem("獎(jiǎng)勵(lì)");

jm42 = new JMenuItem("處分");

m1.add(jm11);

m2.add(jm21);

m2.add(jm22);

m2.add(jm23);

m3.add(jm31);

m3.add(jm32);

m4.add(jm41);

m4.add(jm42);

Icon i1 = new ImageIcon();

Icon i2 = new ImageIcon();

Icon i3 = new ImageIcon();

jb1 = new JButton(i1);

jb1.setToolTipText("輸入");

jb2 = new JButton(i2);

jb2.setToolTipText("查詢");

jb3 = new JButton(i3);

jb3.setToolTipText("退出");

JToolBar tb = new JToolBar("系統(tǒng)工具");

tb.add(jb1);

tb.add(jb2);

tb.add(jb3);

add(tb,BorderLayout.NORTH);

jm11.addActionListener(this);

jm21.addActionListener(this);

jm22.addActionListener(this);

jb1.addActionListener(this);

jb2.addActionListener(this);

jb3.addActionListener(this);

clayout = new CardLayout();

pframe = new JPanel(clayout);

add(pframe);

JPanel mainp = new JPanel(new BorderLayout());

JLabel mainl = new JLabel("學(xué)生信息管理平臺(tái)",SwingConstants.CENTER);

mainl.setFont(new Font("serif",Font.BOLD,30));

mainp.add(mainl);

pframe.add(mainp,"main");

clayout.show(pframe, "main");

}

public void actionPerformed(ActionEvent e){

if(e.getSource() == jm21 || e.getSource() == jb1){

if(ip == null){

ip= new InsertPanel();

pframe.add(ip,"insert");

}

clayout.show(pframe, "insert");

this.setTitle("輸入學(xué)生信息");

}

else if(e.getSource() == jm22 || e.getSource() == jb2){

if(sp == null){

sp= new SelectPanel();

pframe.add(sp,"select");

}

clayout.show(pframe, "select");

this.setTitle("查詢學(xué)生信息");

}

else if(e.getSource() == jm11 || e.getSource() == jb3){

System.exit(0);

}

}

}

第二個(gè):

import javax.swing.JFrame;

public class MainTest {

public static void main(String [] args){

MainFrame f = new MainFrame("學(xué)生信息管理平臺(tái)");

f.setSize(400,300);

f.setLocation(350,250);

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

}

}

第二個(gè):

import java.sql.Connection;

import java.sql.DriverManager;

public class MySQLConnection {

static Connection getCon(){

Connection con = null;

try{

Class.forName("com.mysql.jdbc.Driver");

con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","123");

}

catch(Exception e){

System.out.println("建立數(shù)據(jù)庫(kù)連接遇到異常!");

}

return con;

}

}

第四個(gè):

import java.awt.BorderLayout;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

import javax.swing.SwingConstants;

public class SelectPanel extends JPanel implements ActionListener{

JButton jb;

JTextField jt;

JTextField jt1,jt2,jt3,jt4;

public SelectPanel(){

JLabel jl = new JLabel("請(qǐng)輸入學(xué)號(hào):",SwingConstants.CENTER);

jt = new JTextField();

jb = new JButton("確定");

JPanel jp1 = new JPanel(new GridLayout(1,3));

jp1.add(jl);

jp1.add(jt);

jp1.add(jb);

JLabel j1,j2,j3,j4;

j1 = new JLabel("學(xué)號(hào):",SwingConstants.CENTER);

j2 = new JLabel("姓名:",SwingConstants.CENTER);

j3 = new JLabel("性別:",SwingConstants.CENTER);

j4 = new JLabel("年齡:",SwingConstants.CENTER);

jt1 = new JTextField(6);

jt1.setEditable(false);

jt2 = new JTextField(6);

jt2.setEditable(false);

jt3 = new JTextField(6);

jt3.setEditable(false);

jt4 = new JTextField(6);

jt4.setEditable(false);

JPanel jp2 = new JPanel(new BorderLayout());

JPanel jp3 = new JPanel(new GridLayout(4,2));

jp2.add(new JLabel(""),BorderLayout.NORTH);

jp3.add(j1);

jp3.add(jt1);

jp3.add(j2);

jp3.add(jt2);

jp3.add(j3);

jp3.add(jt3);

jp3.add(j4);

jp3.add(jt4);

jp2.add(jp3);

this.setLayout(new BorderLayout());

add(jp1,BorderLayout.NORTH);

add(jp2);

jb.addActionListener(this);

}

public void actionPerformed(ActionEvent e){

if(e.getSource() == jb){

String stuNo = jt.getText().trim();

Student s = new Student();

boolean b = true;

try{

b = s.selectByStuNo(stuNo);

}

catch(Exception ex){

System.out.println("查詢學(xué)生信息遇到異常!");

}

if(b){

jt1.setText(s.getStuNo());

jt2.setText(s.getName());

jt3.setText(s.getGender());

int a = s.getAge();

Integer i = new Integer(a);

jt4.setText(i.toString());

}

else{

JOptionPane.showMessageDialog(null, "無(wú)此學(xué)生!");

}

}

}

}

第五個(gè):

import javax.swing.JFrame;

public class SelectTest {

public static void main(String [] args){

JFrame f = new JFrame("查詢學(xué)生信息");

SelectPanel p = new SelectPanel();

f.add(p);

f.setSize(400,300);

f.setLocation(300,250);

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

f.setVisible(true);

}

}

第六個(gè):

import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.Statement;

public class Student {

String stuNo;

String name;

String gender;

int age;

public Student(){}

public Student(String stuNo,String name,String gender, int age){

this.stuNo = stuNo;

this.name = name;

this.gender = gender;

this.age = age;

}

public String getStuNo(){

return stuNo;

}

public void setStuNo(String stuNo){

this.stuNo = stuNo;

}

public String getName(){

return name;

}

public void setName(String name){

this.name = name;

}

public String getGender(){

return gender;

}

public void setGender(String gender){

this.gender = gender;

}

public int getAge(){

return age;

}

public void setAge(int age){

this.age = age;

}

public boolean insertStudent(){

boolean b = true;

try{

Connection con = MySQLConnection.getCon();

Statement statement = con.createStatement();

String sql = "insert into student values('" + stuNo + "','" + name +"','" + gender + "'," + age + ")";

sql = new String(sql.getBytes("gb2312"),"ISO8859_1");

statement.executeUpdate(sql);

con.close();

}

catch(Exception e){

b = false;

System.out.println("插入數(shù)據(jù)庫(kù)遇到異常!");

}

return b;

}

public boolean selectByStuNo(String stuNo)throws Exception{

boolean b = true;

Connection con = MySQLConnection.getCon();

Statement statement = con.createStatement();

String sql = "select * from student where stuNo =" + stuNo;

ResultSet rs = statement.executeQuery(sql);

if(rs != null rs.next()){

String no = rs.getString(1);

this.setStuNo(no);

String n = rs.getString(2);

n = new String(n.getBytes("ISO8859_1"),"gb2312");

this.setName(n);

String g = rs.getString(3);

g = new String (g.getBytes("ISO8859_1"),"gb2312");

this.setGender(g);

this.setAge(rs.getInt(4));

b = true;

}

rs.close();

statement.close();

con.close();

return b;

}

}

數(shù)據(jù)庫(kù)你自己弄吧,我沒(méi)時(shí)間弄了!初學(xué)得多動(dòng)手哦

JAVA程序設(shè)計(jì)-簡(jiǎn)單的學(xué)生信息管理系統(tǒng)

我們有這個(gè)小組作業(yè)。

不過(guò)還沒(méi)寫出來(lái)。。

分了任務(wù)的。。。

慢慢寫好了。。。

用JD做吧。。既然你都列了這么多的條條框框,那你應(yīng)該曉得大體怎么構(gòu)建撒。。一個(gè)做有點(diǎn)工作量。不過(guò)感覺(jué)也不是不可能。。就像上學(xué)期做的JAVA記事本一樣。。。頭腦清醒。。多上百度。。哎。。就OK了。

用JAVA怎么編寫停車場(chǎng)管理系統(tǒng)源代碼?

importjava.text.SimpleDateFormat;\x0d\x0aimportjava.util.Date;\x0d\x0aimportjava.util.Scanner;\x0d\x0a\x0d\x0a/*********************************\x0d\x0a*停車場(chǎng)管理\x0d\x0a*authorzhang\x0d\x0a*2013-12-13\x0d\x0a********************************/\x0d\x0apublicclassCarStopManager{\x0d\x0a\x0d\x0apublicstaticvoidmain(String[]args){\x0d\x0aScannersc=newScanner(System.in);\x0d\x0a\x0d\x0aSystem.out.println("請(qǐng)入車牌號(hào):");\x0d\x0aStringcarno=sc.next();\x0d\x0aCarStopManagercarStopManager=newCarStopManager();\x0d\x0acarStopManager.setCarNo(carno);//設(shè)置車牌號(hào)\x0d\x0a\x0d\x0aSimpleDateFormatformat=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");\x0d\x0aStringsdate=format.format(newDate());\x0d\x0aSystem.out.println("當(dāng)前時(shí)間(入場(chǎng)時(shí)間)是:"+sdate);\x0d\x0a\x0d\x0aSystem.out.println("需要開(kāi)出車場(chǎng)嗎?yes/no:");\x0d\x0aStringyesno=sc.next();\x0d\x0a\x0d\x0aif(yesno.equals("yes")){\x0d\x0aStringedate=format.format(newDate());\x0d\x0aSystem.out.println("出場(chǎng)時(shí)間是:"+edate);\x0d\x0a//計(jì)算方法\x0d\x0acarManager(2,sdate,edate,carStopManager);\x0d\x0a}\x0d\x0a}\x0d\x0a/**\x0d\x0a*計(jì)算方法\x0d\x0a*/\x0d\x0apublicstaticvoidcarManager(inttype,StringstarTime,\x0d\x0aStringendTime,CarStopManagercarStopManager){\x0d\x0a\x0d\x0aif(type==1){//按月收費(fèi)\x0d\x0aSystem.out.println("如若沒(méi)有繳納月費(fèi)請(qǐng)繳納800元,如若繳納將不再提示!");\x0d\x0a}else{\x0d\x0a/**\x0d\x0a*一般不會(huì)有停車幾個(gè)月的吧?先不考慮停車幾年或者幾個(gè)月的\x0d\x0a*/\x0d\x0aStringsDay=starTime.substring(8,10);//入場(chǎng)日期(天)\x0d\x0aStringsHour=starTime.substring(11,13);//入場(chǎng)小時(shí)\x0d\x0aStringsMM=starTime.substring(14,16);//入場(chǎng)分鐘\x0d\x0a\x0d\x0aStringeDay=starTime.substring(8,10);//出場(chǎng)日期(天)\x0d\x0aStringeHour=endTime.substring(11,13);//出廠小時(shí)\x0d\x0aStringeMM=endTime.substring(14,16);//出廠分鐘\x0d\x0a\x0d\x0afloatmoney=0;//需繳納的費(fèi)用\x0d\x0aintshour=Integer.parseInt(sHour);\x0d\x0aintehour=Integer.parseInt(eHour);\x0d\x0aintsmm=Integer.parseInt(sMM);\x0d\x0aintemm=Integer.parseInt(eMM);\x0d\x0aintrehour=0;//停車幾個(gè)小時(shí)\x0d\x0a\x0d\x0aif(sDay.equals(eDay)){//同一天\x0d\x0a//當(dāng)天6點(diǎn)到20點(diǎn)之間\x0d\x0aif((shour=6shour

回答于?2022-12-14

簡(jiǎn)單的JAVA學(xué)生管理系統(tǒng)代碼···

lListStudent students = new ArrayListStudent();

BufferedReader br = new BufferedReader(new FileReader("D:\student.txt"));

String tmpStr = br.readLine();

while(tmpStr != null){

int firstIndex = tmpStr.indexOf(" ");

int secondIndex = tmpStr.indexOf(" ",firstIndex + 1);

int thirdIndex = tmpStr.indexOf(" ", secondIndex + 1);

int forthIndex = tmpStr.indexOf(" ", thirdIndex + 1);

Integer stuId = Integer.parseInt(tmpStr.substring(0,firstIndex));

String stuName = tmpStr.substring(firstIndex + 1,secondIndex);

Integer stuYW = Integer.parseInt(tmpStr.substring(secondIndex + 1,thirdIndex));

Integer stuSX = Integer.parseInt(tmpStr.substring(thirdIndex + 1,forthIndex));

Integer stuYY = Integer.parseInt(tmpStr.substring(forthIndex + 1));

Student student = new Student();

student.setStuId(stuId);

student.setStuName(stuName);

student.setStuYW(stuYW);

student.setStuSX(stuSX);

student.setStuYY(stuYY);

students.add(student);

tmpStr.readLine();

}

//創(chuàng)建一個(gè)學(xué)生實(shí)體類 封裝stuId stuName stuYW stuSx stuYY 這5個(gè)屬性。。。

//已經(jīng)幫你把數(shù)據(jù)拆分出來(lái) 并以Student 對(duì)象的形式放入集合中了 接下來(lái) 給分吧 哇咔咔


本文標(biāo)題:java管理系統(tǒng)簡(jiǎn)單代碼 java管理系統(tǒng)源碼
URL網(wǎng)址:http://weahome.cn/article/hgcise.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部