网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

java实训系统代码的简单介绍

这是我们的java实训内容,有没有大神知道其中的代码怎么打?知道几条也行,谢谢了! 2、 能新

2,3已经实现,其他的自己试着做一下不难

创新互联是一家集网站建设,六枝企业网站建设,六枝品牌网站建设,网站定制,六枝网站建设报价,网络营销,网络优化,六枝网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。

package com.ui;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

class NoteBook{

//创建文件

public File creatFile(String path,String name){

File tempPath=new File(path);

File tempFile=new File(path+File.separator+name+".txt");

if(!tempPath.exists()){

tempPath.mkdirs();

try {

tempFile.createNewFile();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}else{

try {

tempFile.createNewFile();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

return tempFile;

}

//写入文件

public void writeFile(File file,String content){

try {

FileOutputStream fos=new FileOutputStream(file);

fos.write(content.getBytes());

fos.close();

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

//读取文件

public String readFile(File file){

String str="";

try {

FileInputStream fis=new FileInputStream(file);

int datas;

while((datas=fis.read())!=-1){

str+=String.valueOf((char)datas);

}

} catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

return str;

}

//复制文件

public  void copyFile(File f1,File f2){

if(!f1.exists()){

System.out.println("目录"+f1.getName()+"不存在");

}else{

File[] files=f1.listFiles();

for(File f:files){

if(f.isDirectory()){

File temp=new File(f2,f.getName());

temp.mkdirs();

copyFile(f, temp);

}else{

File temp=new File(f2,f.getName());

try {

temp.createNewFile();

FileOutputStream fos=new FileOutputStream(temp);

FileInputStream fis=new FileInputStream(f);

int datas;

while((datas=fis.read())!=-1){

fos.write(datas);

}

fos.close();

fis.close();

} catch (FileNotFoundException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

}

}

//剪贴文件

public void cutFile(File f1,File f2){

int i=0;

if(!f1.exists()){

System.out.println("目录"+f1.getName()+"不存在");

}else{

i++;

File[] files=f1.listFiles();

for(File f:files){

if(f.isDirectory()){

File temp=new File(f2,f.getName());

temp.mkdirs();

cutFile(f, temp);

}else{

File temp=new File(f2,f.getName());

try {

temp.createNewFile();

FileOutputStream fos=new FileOutputStream(temp);

FileInputStream fis=new FileInputStream(f);

int datas;

while((datas=fis.read())!=-1){

fos.write(datas);

}

fis.close();

fos.close();

f.delete();

} catch (FileNotFoundException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

}

f1.delete();

}

}

请高手帮忙解决一个JAVA实验程序!!

我把你的第一个给你贴上来吧,第二个应该也很简单,不过我懒得麻烦,而且你那个什么试验五我也不清楚,代码如下:

interface A{

public int method1(int x);

public int method2(int x,int y);

}

class B implements A{

public int method1(int x) {

// TODO Auto-generated method stub

int n = 1;

for(;x0;x--)

n=n*5;

return n;

}

public int method2(int x, int y) {

// TODO Auto-generated method stub

if(xy)

return y;

else return x;

}

}

public class test{

public static void main(String[] args){

B b=new B();

System.out.println(b.method1(2));

System.out.println(b.method2(2,8));

}

}

我全部都放到一起了,还有如果什么别的你不喜欢的地方,你自己改改,拿分走人。。。。

毕业实训啊,那位大哥给个学生学籍信息管理系统java源代码,感激不尽

百度一下,想飞社区,在资源里有,应该是在“JAVA开发-JAVA实例”分类下面。还有不少JAVA方面的案例源码,你可以参考一下。


本文名称:java实训系统代码的简单介绍
浏览路径:http://bjjierui.cn/article/dohhhep.html

其他资讯