第一個(gè)if是判斷searchkey是不是空的,如果不是空的,就追加到name字段作為查詢(xún)條件,like模糊查詢(xún)
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到蕪湖縣網(wǎng)站設(shè)計(jì)與蕪湖縣網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋蕪湖縣地區(qū)。
接著第二個(gè)if判斷如果status的值不為空,就追加到status作為條件
如果status為空,走else分支,從userContext中獲取到employee對(duì)象,接著判斷,如果它的角色不是manager的話(huà)
把這個(gè)對(duì)象的id拿出來(lái),作為seller.Id的條件進(jìn)行查詢(xún)
2,3已經(jīng)實(shí)現(xiàn),其他的自己試著做一下不難
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{
//創(chuàng)建文件
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;
}
//寫(xiě)入文件
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;
}
//復(fù)制文件
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();
}
}
Shape.java接口代碼
public interface Shape {
public static final double PI = 3.14d;
public double area();
}
Circle.java圓類(lèi)代碼
public class Circle implements Shape {
private double radius;
public Circle(double radius) {
? this.radius = radius;
}
@Override
public double area() {
? return PI * this.radius * this.radius;
}
public double perimeter() {
? return 2 * PI * this.radius;
}
}
Cylinder.java圓柱體類(lèi)代碼
public class Cylinder extends Circle {
private double height;
public Cylinder(double radius, double height) {
? super(radius);
? this.height = height;
}
public double area() {
? return 2 * super.area() + super.perimeter() * this.height;
}
public double volume() {
? return super.area() * this.height;
}
}
X5_3_6.java主類(lèi)代碼
public class X5_3_6 {
public static void main(String[] args) {
? Circle cir1 = new Circle(5);
? System.out.println("圓的面積為:" + cir1.area());
? System.out.println("圓的周長(zhǎng)為:" + cir1.perimeter());
? Cylinder cy1 = new Cylinder(10, 15);
? System.out.println("圓柱體的表面積為:" + cy1.area());
? System.out.println("圓柱體的體積為:" + cy1.volume());
}
}
上面是我寫(xiě)的代碼,下圖是執(zhí)行結(jié)果,麻煩看一下,是否可以。
標(biāo)題名稱(chēng):java實(shí)訓(xùn)代碼怎么講 java實(shí)戰(zhàn)教程
本文網(wǎng)址:http://chinadenli.net/article34/hpeipe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開(kāi)發(fā)、域名注冊(cè)、靜態(tài)網(wǎng)站、響應(yīng)式網(wǎng)站、網(wǎng)站內(nèi)鏈、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)