亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Java簡(jiǎn)單實(shí)現(xiàn)銀行ATM系統(tǒng)

 更新時(shí)間:2022年05月27日 10:15:21   作者:息壤愛(ài)學(xué)習(xí)  
這篇文章主要為大家詳細(xì)介紹了Java簡(jiǎn)單實(shí)現(xiàn)銀行ATM系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Java實(shí)現(xiàn)銀行ATM系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下

實(shí)現(xiàn)步驟:

定義賬戶類,用于后期創(chuàng)建賬戶對(duì)象封裝用戶的賬戶信息。

賬戶類中的信息至少需要包含(卡號(hào)、姓名、密碼、余額、取現(xiàn)額度)

需要準(zhǔn)備一個(gè)ArrayList的集合,用于存儲(chǔ)系統(tǒng)用戶的賬戶對(duì)象。

定義一個(gè)系統(tǒng)啟動(dòng)類ATMSystem需要展示歡迎頁(yè)包含2個(gè)功能:開(kāi)戶功能、登錄賬戶。

賬戶類 Account

package test;
/*賬戶類*/
public class Account {
? ? private String cardId; //卡號(hào)
? ? private String userName; //客戶名字
? ? private String password; //密碼
? ? private double money; //余額
? ? private double quoteMoney; //當(dāng)次限額
? ? public Account(){}
? ? public Account(String cardId,String userName,String password,double quoteMoney){
? ? ? ? this.cardId = cardId;
? ? ? ? this.userName =userName;
? ? ? ? this.password = password;
? ? ? ? this.quoteMoney = quoteMoney;
? ? }

? ? public String getCardId() {
? ? ? ? return cardId;
? ? }

? ? public void setCardId(String cardId) {
? ? ? ? this.cardId = cardId;
? ? }

? ? public double getMoney() {
? ? ? ? return money;
? ? }

? ? public void setMoney(double money) {
? ? ? ? this.money = money;
? ? }

? ? public double getQuoteMoney() {
? ? ? ? return quoteMoney;
? ? }

? ? public void setQuoteMoney(double quoteMoney) {
? ? ? ? this.quoteMoney = quoteMoney;
? ? }

? ? public String getPassword() {
? ? ? ? return password;
? ? }

? ? public void setPassword(String password) {
? ? ? ? this.password = password;
? ? }

? ? public String getUserName() {
? ? ? ? return userName;
? ? }

? ? public void setUserName(String userName) {
? ? ? ? this.userName = userName;
? ? }
}

AtmSystem 類

package test;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class AtmSystem {
? ? public static void main(String[] args) {
? ? ? ? //用數(shù)組儲(chǔ)存賬戶對(duì)象
? ? ? ? ArrayList<Account> accounts = new ArrayList<>();
? ? ? ? //首頁(yè):登錄 開(kāi)戶
? ? ? ? showMain(accounts);
? ? }
? ? public static void showMain(ArrayList<Account> accounts){
? ? ? ? System.out.println("================歡迎進(jìn)入首頁(yè)界面===============");
? ? ? ? Scanner sc = new Scanner(System.in);
? ? ? ? while (true){
? ? ? ? ? ? System.out.println("請(qǐng)輸入您想要進(jìn)行的操作:");
? ? ? ? ? ? System.out.println("1.登錄");
? ? ? ? ? ? System.out.println("2.開(kāi)戶");
? ? ? ? ? ? System.out.println("您可以輸入命令了:");
? ? ? ? ? ? int command = sc.nextInt();
? ? ? ? ? ? switch (command){
? ? ? ? ? ? ? ? case 1:
? ? ? ? ? ? ? ? ? ? //登錄
? ? ? ? ? ? ? ? ? ? login(accounts,sc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? case 2:
? ? ? ? ? ? ? ? ? ? //開(kāi)戶
? ? ? ? ? ? ? ? ? ? register(accounts,sc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? default:
? ? ? ? ? ? ? ? ? ? System.out.println("您的輸入有誤!");
? ? ? ? ? ? }
? ? ? ? }
? ? }
// ? ? ? ? ? ?鍵盤(pán)錄入姓名、密碼、確認(rèn)密碼(需保證兩次密碼一致)
//
// ? ? ? ? ? ?生成賬戶卡號(hào),卡號(hào)必須由系統(tǒng)自動(dòng)生成8位數(shù)字(必須保證卡號(hào)的唯一)
//
// ? ? ? ? ? ?創(chuàng)建Account賬戶類對(duì)象用于封裝賬戶信息(姓名、密碼、卡號(hào))
//
// ? ? ? ? ? ?把Account賬戶類對(duì)象存入到集合accounts中去。
? ? public static void register(ArrayList<Account> accounts,Scanner sc){
? ? ? ? System.out.println("===============用戶開(kāi)戶================");
? ? ? ? System.out.println("請(qǐng)輸入開(kāi)戶名稱:");
? ? ? ? String name = sc.next();
? ? ? ? String password = "";
? ? ? ? while (true){
? ? ? ? ? ? System.out.println("請(qǐng)輸入開(kāi)戶密碼:");
? ? ? ? ? ? password = sc.next();
? ? ? ? ? ? System.out.println("請(qǐng)?jiān)俅未_認(rèn)密碼:");
? ? ? ? ? ? String okPassword = sc.next();
? ? ? ? ? ? //判斷兩次輸入密碼
? ? ? ? ? ? if (okPassword.equals(password)){
? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? System.out.println("兩次密碼必須一致");
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? System.out.println("請(qǐng)輸入當(dāng)次限額:");
? ? ? ? double quotaMoney = sc.nextDouble();
? ? ? ? String cardId = createCard(accounts);
? ? ? ? //封裝賬戶
? ? ? ? Account account = new Account(cardId,name,password,quotaMoney);
? ? ? ? accounts.add(account);
? ? ? ? System.out.println("恭喜您,開(kāi)戶成功!你的卡號(hào)是:"+account.getCardId()+"請(qǐng)您妥善保管!");
? ? }
? ? public static String createCard(ArrayList<Account> accounts){
? ? ? ? while (true){
? ? ? ? ? ? //生成8位隨機(jī)號(hào)碼,且不重復(fù)
? ? ? ? ? ? String cardId = "";
? ? ? ? ? ? Random r = new Random();
? ? ? ? ? ? for (int i=0;i<8;i++){
? ? ? ? ? ? ? ? cardId += r.nextInt(10);
? ? ? ? ? ? }
? ? ? ? ? ? Account acc = getAccountByCardId(cardId, accounts);
? ? ? ? ? ? if (acc == null){
? ? ? ? ? ? ? ? return cardId;
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? public static Account getAccountByCardId(String cardId,ArrayList<Account> accounts){
? ? ? ? for (int i=0;i< accounts.size();i++){
? ? ? ? ? ? Account acc = accounts.get(i);
? ? ? ? ? ? if (acc.getCardId().equals(cardId)){
? ? ? ? ? ? ? ? return acc;
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? return null;
? ? }
? ? //登錄
// ? ? ? ? ? ?讓用戶鍵盤(pán)錄入卡號(hào),根據(jù)卡號(hào)查詢賬戶對(duì)象。
//
// ? ? ? ? ? ?如果沒(méi)有找到了賬戶對(duì)象,說(shuō)明卡號(hào)不存在,提示繼續(xù)輸入卡號(hào)。
//
// ? ? ? ? ? ?如果找到了賬戶對(duì)象,說(shuō)明卡號(hào)存在,繼續(xù)輸入密碼。
//
// ? ? ? ? ? ?如果密碼不正確,提示繼續(xù)輸入密碼
//
// ? ? ? ? ? ?如果密碼正確,提示登陸成功??!
? ? public static void login(ArrayList<Account> accounts,Scanner sc){
? ? ? ? //判斷系統(tǒng)中是否存在賬戶
? ? ? ? if (accounts.size()==0){
? ? ? ? ? ? System.out.println("當(dāng)前系統(tǒng)查無(wú)此賬戶,請(qǐng)注冊(cè)!");
? ? ? ? ? ? return;
? ? ? ? }
? ? ? ? while (true){
? ? ? ? ? ? System.out.println("請(qǐng)輸入登錄賬號(hào):");
? ? ? ? ? ? String cardId = sc.next();
? ? ? ? ? ? Account acc = getAccountByCardId(cardId,accounts);
? ? ? ? ? ? if (acc!=null){
? ? ? ? ? ? ? ? while (true){
? ? ? ? ? ? ? ? ? ? //輸入密碼
? ? ? ? ? ? ? ? ? ? System.out.println("請(qǐng)輸入密碼:");
? ? ? ? ? ? ? ? ? ? String password = sc.next();
? ? ? ? ? ? ? ? ? ? if (acc.getPassword().equals(password)){
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("恭喜您," + acc.getUserName() + "先生/女士成功登錄!" + "您的賬戶:" + acc.getCardId());
? ? ? ? ? ? ? ? ? ? ? ? //展示操作頁(yè)面
? ? ? ? ? ? ? ? ? ? ? ? showUserCommand(sc,acc,accounts);
? ? ? ? ? ? ? ? ? ? ? ? return;
? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("Sorry,該賬戶不存在!");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? private static void showUserCommand(Scanner sc, Account acc , ArrayList<Account> accounts) {
? ? ? ? while (true) {
? ? ? ? ? ? System.out.println("==================用戶操作界面===================");
? ? ? ? ? ? System.out.println("1、查詢賬戶");
? ? ? ? ? ? System.out.println("2、存款");
? ? ? ? ? ? System.out.println("3、取款");
? ? ? ? ? ? System.out.println("4、轉(zhuǎn)賬");
? ? ? ? ? ? System.out.println("5、修改密碼");
? ? ? ? ? ? System.out.println("6、退出");
? ? ? ? ? ? System.out.println("7、注銷賬戶");
? ? ? ? ? ? System.out.println("請(qǐng)您輸入操作命令:");
? ? ? ? ? ? int command = sc.nextInt();
? ? ? ? ? ? switch (command) {
? ? ? ? ? ? ? ? case 1:
? ? ? ? ? ? ? ? ? ? // 查詢賬戶
? ? ? ? ? ? ? ? ? ? showAccount(acc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? case 2:
? ? ? ? ? ? ? ? ? ? // 存款
? ? ? ? ? ? ? ? ? ? depositMoney(acc, sc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? case 3:
? ? ? ? ? ? ? ? ? ? // 取款
? ? ? ? ? ? ? ? ? ? drawMoney(acc,sc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? case 4:
? ? ? ? ? ? ? ? ? ? // 轉(zhuǎn)賬
? ? ? ? ? ? ? ? ? ? transferMoney(accounts, acc , sc);
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? case 5:
? ? ? ? ? ? ? ? ? ? // 修改密碼
? ? ? ? ? ? ? ? ? ? updatePassWord(acc,sc);
? ? ? ? ? ? ? ? ? ? return; // 結(jié)束當(dāng)前操作的方法
? ? ? ? ? ? ? ? case 6:
? ? ? ? ? ? ? ? ? ? // 退出
? ? ? ? ? ? ? ? ? ? System.out.println("歡迎下次光臨??!");
? ? ? ? ? ? ? ? ? ? return; // 結(jié)束當(dāng)前操作的方法!
? ? ? ? ? ? ? ? case 7:
? ? ? ? ? ? ? ? ? ? // 注銷賬戶
? ? ? ? ? ? ? ? ? ? // 從當(dāng)前集合中抹掉當(dāng)前賬戶對(duì)象即可
? ? ? ? ? ? ? ? ? ? accounts.remove(acc);
? ? ? ? ? ? ? ? ? ? System.out.println("銷戶成功了??!");
? ? ? ? ? ? ? ? ? ? return;// 結(jié)束當(dāng)前操作的方法!
? ? ? ? ? ? ? ? default:
? ? ? ? ? ? ? ? ? ? System.out.println("您的命令輸入有誤~~~");
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? private static void showAccount(Account acc) {
? ? ? ? System.out.println("==================當(dāng)前賬戶詳情===================");
? ? ? ? System.out.println("卡號(hào):" + acc.getCardId());
? ? ? ? System.out.println("姓名:" + acc.getUserName());
? ? ? ? System.out.println("余額:" + acc.getMoney());
? ? ? ? System.out.println("當(dāng)次限額:" + acc.getQuoteMoney());
? ? }
// ? ? ? ? ? ?存款就是拿到當(dāng)前賬戶對(duì)象。
//
// ? ? ? ? ? ?然后讓用戶輸入存款的金額。
//
// ? ? ? ? ? ?調(diào)用賬戶對(duì)象的setMoney方法將賬戶余額修改成存錢后的余額。
//
// ? ? ? ? ? ?存錢后需要查詢一下賬戶信息,確認(rèn)是否存錢成功了!
? ? private static void depositMoney(Account acc, Scanner sc) {
? ? ? ? System.out.println("==================存錢操作===================");
? ? ? ? System.out.println("請(qǐng)您輸入存款的金額:");
? ? ? ? double money = sc.nextDouble();

? ? ? ? // 直接把金額修改到賬戶對(duì)象的money屬性中去
? ? ? ? acc.setMoney(acc.getMoney() + money);
? ? ? ? System.out.println("存款完成??!");
? ? ? ? showAccount(acc);
? ? }
// ? ? ? ? ? ?取款需要先判斷賬戶是否有錢。
//
// ? ? ? ? ? ?有錢則拿到自己賬戶對(duì)象。
//
// ? ? ? ? ? ?然后讓用戶輸入取款金額
//
// ? ? ? ? ? ?判斷取款金額是否超過(guò)了當(dāng)次限額,以及余額是否足夠
//
// ? ? ? ? ? ?滿足要求則調(diào)用賬戶對(duì)象的setMoney方法完成金額的修改。
? ? private static void drawMoney(Account acc, Scanner sc) {
? ? ? ? System.out.println("==================取款操作===================");
? ? ? ? // 1、判斷它的賬戶是否足夠100元
? ? ? ? if(acc.getMoney() >= 100){
? ? ? ? ? ? while (true) {
? ? ? ? ? ? ? ? System.out.println("請(qǐng)您輸入取款的金額:");
? ? ? ? ? ? ? ? double money = sc.nextDouble();
? ? ? ? ? ? ? ? // 2、判斷這個(gè)金額有沒(méi)有超過(guò)當(dāng)次限額
? ? ? ? ? ? ? ? if(money > acc.getQuoteMoney()){
? ? ? ? ? ? ? ? ? ? System.out.println("您當(dāng)次取款金額超過(guò)每次限額,不要取那么多,每次最多可以?。? + acc.getQuoteMoney());
? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? // 3、判斷當(dāng)前余額是否足夠你取錢
? ? ? ? ? ? ? ? ? ? if(acc.getMoney() >= money){
? ? ? ? ? ? ? ? ? ? ? ? // 夠錢,可以取錢了
? ? ? ? ? ? ? ? ? ? ? ? acc.setMoney(acc.getMoney() - money);
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("恭喜您,取錢" + money + "成功了!當(dāng)前賬戶還剩余:" + acc.getMoney());
? ? ? ? ? ? ? ? ? ? ? ? return;// 取錢后干掉取錢方法
? ? ? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("余額不足?。?);
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }else {
? ? ? ? ? ? System.out.println("您自己的金額沒(méi)有超過(guò)100元,就別取了~~~");
? ? ? ? }
? ? }
// ? ? ? ? ? ?轉(zhuǎn)賬功能需要判斷系統(tǒng)中是否有2個(gè)賬戶對(duì)象及以上。
//
// ? ? ? ? ? ?同時(shí)還要判斷自己賬戶是否有錢。
//
// ? ? ? ? ? ?接下來(lái)需要輸入對(duì)方卡號(hào),判斷對(duì)方賬戶是否存在。
//
// ? ? ? ? ? ?對(duì)方賬戶存在還需要認(rèn)證對(duì)方戶主的姓氏。
//
// ? ? ? ? ? ?滿足要求則可以把自己賬戶對(duì)象的金額修改到對(duì)方賬戶對(duì)象中去。
? ? private static void transferMoney(ArrayList<Account> accounts, Account acc, Scanner sc) {
? ? ? ? // 1、判斷系統(tǒng)中是否有2個(gè)賬戶及以上
? ? ? ? if(accounts.size() < 2){
? ? ? ? ? ? System.out.println("對(duì)不起,系統(tǒng)中無(wú)其他賬戶,您不可以轉(zhuǎn)賬!");
? ? ? ? ? ? return;
? ? ? ? }

? ? ? ? // 2、判斷自己的賬戶對(duì)象中是否有錢
? ? ? ? if(acc.getMoney() == 0){
? ? ? ? ? ? System.out.println("對(duì)不起,您自己都沒(méi)錢,就別轉(zhuǎn)了~~");
? ? ? ? ? ? return;
? ? ? ? }

? ? ? ? // 3、開(kāi)始轉(zhuǎn)賬邏輯
? ? ? ? while (true) {
? ? ? ? ? ? System.out.println("請(qǐng)您輸入對(duì)方賬戶的卡號(hào):");
? ? ? ? ? ? String cardId = sc.next();
? ? ? ? ? ? Account account = getAccountByCardId(cardId , accounts);
? ? ? ? ? ? // 判斷這個(gè)賬戶對(duì)象是否存在,存在說(shuō)明對(duì)方卡號(hào)輸入正確
? ? ? ? ? ? if(account != null){
? ? ? ? ? ? ? ? // 判斷這個(gè)賬戶對(duì)象是否是當(dāng)前登錄的賬戶自己
? ? ? ? ? ? ? ? if(account.getCardId().equals(acc.getCardId())){
? ? ? ? ? ? ? ? ? ? // 正在給自己轉(zhuǎn)賬
? ? ? ? ? ? ? ? ? ? System.out.println("您不可以為自己轉(zhuǎn)賬!");
? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? // 確認(rèn)對(duì)方的姓氏
? ? ? ? ? ? ? ? ? ? String name = "*" + account.getUserName().substring(1);
? ? ? ? ? ? ? ? ? ? System.out.print("請(qǐng)您確認(rèn)【" + name + "】的姓氏:");
? ? ? ? ? ? ? ? ? ? String preName = sc.next(); // 王
? ? ? ? ? ? ? ? ? ? if(account.getUserName().startsWith(preName)){
? ? ? ? ? ? ? ? ? ? ? ? // 真正開(kāi)始轉(zhuǎn)賬了
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("請(qǐng)您輸入轉(zhuǎn)賬的金額:");
? ? ? ? ? ? ? ? ? ? ? ? double money = sc.nextDouble();
? ? ? ? ? ? ? ? ? ? ? ? // 判斷這個(gè)金額是否超過(guò)了自己的余額
? ? ? ? ? ? ? ? ? ? ? ? if(money > acc.getMoney() ){
? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("對(duì)不起,您要轉(zhuǎn)賬的金額太多,您最多可以轉(zhuǎn)賬多少:" + acc.getMoney());
? ? ? ? ? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? ? ? ? ? // 真的可以轉(zhuǎn)了
? ? ? ? ? ? ? ? ? ? ? ? ? ? acc.setMoney(acc.getMoney() - money);
? ? ? ? ? ? ? ? ? ? ? ? ? ? account.setMoney(account.getMoney() + money);
? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("恭喜您,轉(zhuǎn)賬成功了,已經(jīng)為" + account.getUserName() +"轉(zhuǎn)賬多少:" + money);
? ? ? ? ? ? ? ? ? ? ? ? ? ? showAccount(acc);
? ? ? ? ? ? ? ? ? ? ? ? ? ? return;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("對(duì)不起,您認(rèn)證的信息有誤~~~");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? System.out.println("對(duì)不起,您輸入的轉(zhuǎn)賬卡號(hào)有問(wèn)題!");
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? private static void updatePassWord(Account acc, Scanner sc) {
? ? ? ? System.out.println("===========修改密碼=======================");
? ? ? ? while (true) {
? ? ? ? ? ? System.out.println("請(qǐng)您輸入正確的密碼:");
? ? ? ? ? ? String okPassWord = sc.next();
? ? ? ? ? ? // 判斷密碼是否正確
? ? ? ? ? ? if(acc.getPassword().equals(okPassWord)){
? ? ? ? ? ? ? ? while (true) {
? ? ? ? ? ? ? ? ? ? // 可以輸入新密碼
? ? ? ? ? ? ? ? ? ? System.out.println("請(qǐng)您輸入新的密碼:");
? ? ? ? ? ? ? ? ? ? String newPassWord = sc.next();

? ? ? ? ? ? ? ? ? ? System.out.println("請(qǐng)您輸入確認(rèn)密碼:");
? ? ? ? ? ? ? ? ? ? String okNewPassWord = sc.next();

? ? ? ? ? ? ? ? ? ? if(newPassWord.equals(okNewPassWord)) {
? ? ? ? ? ? ? ? ? ? ? ? // 修改賬戶對(duì)象的密碼為新密碼
? ? ? ? ? ? ? ? ? ? ? ? acc.setPassword(newPassWord);
? ? ? ? ? ? ? ? ? ? ? ? return; // 直接結(jié)束掉?。?
? ? ? ? ? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? ? ? ? ? System.out.println("您兩次輸入的密碼不一致~~");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }

? ? ? ? ? ? }else {
? ? ? ? ? ? ? ? System.out.println("當(dāng)前輸入的密碼不正確~~~");
? ? ? ? ? ? }
? ? ? ? }

? ? }
}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 靜態(tài)方法中調(diào)用Spring注入過(guò)程解析

    靜態(tài)方法中調(diào)用Spring注入過(guò)程解析

    這篇文章主要介紹了靜態(tài)方法中調(diào)用Spring注入過(guò)程解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-11-11
  • Java動(dòng)態(tài)線程池插件dynamic-tp集成過(guò)程淺析

    Java動(dòng)態(tài)線程池插件dynamic-tp集成過(guò)程淺析

    這篇文章主要介紹了Java動(dòng)態(tài)線程池插件dynamic-tp集成過(guò)程,dynamic-tp是一個(gè)輕量級(jí)的動(dòng)態(tài)線程池插件,它是一個(gè)基于配置中心的動(dòng)態(tài)線程池,線程池的參數(shù)可以通過(guò)配置中心配置進(jìn)行動(dòng)態(tài)的修改
    2023-03-03
  • Java實(shí)現(xiàn)象棋算法的示例代碼

    Java實(shí)現(xiàn)象棋算法的示例代碼

    象棋算法包括搜索算法、評(píng)估函數(shù)和剪枝算法,本文主要介紹了Java實(shí)現(xiàn)象棋算法的示例代碼,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-12-12
  • MyBatis之foreach標(biāo)簽的用法及多種循環(huán)問(wèn)題

    MyBatis之foreach標(biāo)簽的用法及多種循環(huán)問(wèn)題

    這篇文章主要介紹了MyBatis之foreach標(biāo)簽的用法及多種循環(huán)問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-11-11
  • Java設(shè)計(jì)模式之適配器模式的示例詳解

    Java設(shè)計(jì)模式之適配器模式的示例詳解

    適配器模式,即將某個(gè)類的接口轉(zhuǎn)換成客戶端期望的另一個(gè)接口的表示,主要目的是實(shí)現(xiàn)兼容性,讓原本因?yàn)榻涌诓黄ヅ洌瑳](méi)辦法一起工作的兩個(gè)類,可以協(xié)同工作。本文將通過(guò)示例詳細(xì)介紹適配器模式,需要的可以參考一下
    2022-08-08
  • Spring執(zhí)行sql腳本文件的方法

    Spring執(zhí)行sql腳本文件的方法

    這篇文章主要介紹了Spring執(zhí)行sql腳本文件的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2019-03-03
  • 帶你輕松搞定Java面向?qū)ο蟮木幊?-數(shù)組,集合框架

    帶你輕松搞定Java面向?qū)ο蟮木幊?-數(shù)組,集合框架

    Java是面向?qū)ο蟮母呒?jí)編程語(yǔ)言,類和對(duì)象是 Java程序的構(gòu)成核心。圍繞著Java類和Java對(duì)象,有三大基本特性:封裝是Java 類的編寫(xiě)規(guī)范、繼承是類與類之間聯(lián)系的一種形式、而多態(tài)為系統(tǒng)組件或模塊之間解耦提供了解決方案
    2021-06-06
  • Java如何使用HTTPclient訪問(wèn)url獲得數(shù)據(jù)

    Java如何使用HTTPclient訪問(wèn)url獲得數(shù)據(jù)

    這篇文章主要介紹了Java使用HTTPclient訪問(wèn)url獲得數(shù)據(jù)的操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-09-09
  • Eclipse創(chuàng)建JavaWeb工程的完整步驟記錄

    Eclipse創(chuàng)建JavaWeb工程的完整步驟記錄

    很多新手不知道Eclipse怎么創(chuàng)建Java Web項(xiàng)目,一起來(lái)看看吧,這篇文章主要給大家介紹了關(guān)于Eclipse創(chuàng)建JavaWeb工程的完整步驟,需要的朋友可以參考下
    2023-10-10
  • 深入解析Spring中的@Bean注解

    深入解析Spring中的@Bean注解

    這篇文章主要介紹了深入解析Spring中的@Bean注解,Spring的@Bean注解用于告訴方法,產(chǎn)生一個(gè)Bean對(duì)象,然后這個(gè)Bean對(duì)象交給Spring管理,產(chǎn)生這個(gè)Bean對(duì)象的方法Spring只會(huì)調(diào)用一次,隨后這個(gè)Spring將會(huì)將這個(gè)Bean對(duì)象放在自己的IOC容器中,需要的朋友可以參考下
    2023-07-07

最新評(píng)論