会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132597个问题
Python 全系列/ 第十四阶段:自动化操作办公软件、邮件、定时任务等/办公自动化 27586楼

老师好,测试下拉按钮在点击下拉时会报错,把全部 .js文件都粘贴进去也不行,

试了“https://popper.js.org/”这个上面提供的CDN,引用的时候就报错,不知道怎么解决,帮忙指点一下,谢谢!

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test</title>
    <link rel="stylesheet" href="./BootStrap/bootstrap.min.css">
    <script src="./BootStrap/jquery-1.12.4.min.js"></script>
    <script src="./BootStrap/bootstrap.min.js"></script>
    <style>

    </style>
</head>
<body>
    <div class="btn-group">
        <button type="button" class="btn btn-danger">Action</button>
        <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
        </ul>
    </div>

</body>
</html>

image.png

WEB前端全系列/第四阶段:BootStrap框架模块/BootStrap4组件 27587楼

微信图片编辑_20220615072649.jpg

Python 全系列/第一阶段:Python入门/编程基本概念 27589楼
JAVA 全系列/第一阶段:JAVA 快速入门/JAVA入门和背景知识 27592楼

这是什么原因?

图像.png

图像.png

package TCP通信.项目;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

class Send extends Thread{
    private Socket socket;

    public Send( Socket socket ) {
        this.socket = socket;
    }

    @Override
    public void run( ) {
        this.sendMsg();
    }
    private void sendMsg(){
        try( Scanner sc = new Scanner(System.in)){

            PrintWriter pw=new PrintWriter(socket.getOutputStream());
            while ( true ){
                String msg=sc.next();
                pw.println(msg);
                pw.flush();
            }
        }  catch ( Exception e ) {
            e.printStackTrace();
        }
    }
}
class Recevie extends Thread{
    private Socket socket;

    public Recevie( Socket socket ) {
        this.socket = socket;
    }

    @Override
    public void run( ) {
        this.recevieMsg();
    }
    public void recevieMsg(){
        try( BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()))){
            while ( true ){
                String msg=br.readLine();
                System.out.println("他说"+msg );

            }

        }  catch ( Exception e ) {
            e.printStackTrace();
        }
    }
}
public class ChatSocketServer {
    public static void main( String[] args ) {
     try(ServerSocket serverSocket = new ServerSocket(8888);){
         System.out.println( "服务器已启动,等待监听............" );
         Socket socket=serverSocket.accept();
         System.out.println("连接成功!" );

         new Send( socket ).start();
         new Recevie( socket ).start();
     }  catch ( Exception e ) {
         e.printStackTrace();
     }
    }
}
.............................................................
package TCP通信.项目;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

class ClientSend extends Thread{
    private Socket socket;

    public ClientSend( Socket socket ) {
        this.socket = socket;
    }

    @Override
    public void run( ) {
        this.sendMsg();
    }
    private void sendMsg(){
        try( Scanner sc=new Scanner(System.in);
             PrintWriter pw = new PrintWriter(socket.getOutputStream());){
            while ( true ){
                String msg = sc.next();
                pw.println(msg);
                pw.flush();
            }

        }catch( Exception e ){
            e.printStackTrace();
        }
    }
}


class ClientReceive extends Thread{
    private Socket socket;

    public ClientReceive( Socket socket ) {
        this.socket = socket;
    }

    @Override
    public void run( ) {
        super.run( );
    }
    private void receiveMsg(){
        try( BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()))){
            while ( true ){
                String msg=br.readLine();
                System.out.println("他说:"+msg );

            }

        }  catch ( Exception e ) {
            e.printStackTrace();
        }
    }
}
public class ChatSocketClient {
    public static void main( String[] args ) {
        try{
            Socket socket = new Socket("127.0.0.1", 8888);
            System.out.println("连接成功" );
            new ClientSend( socket ).start();
            new ClientReceive( socket ).start();
        }catch (Exception e ){
            e.printStackTrace();
        }
    }
}


JAVA 全系列/第二阶段:JAVA 基础深化和提高/网络编程 27595楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 27596楼

image.png


public class Z1 {
    public static void main(String[] args) {
        BiaoGe op0 = new BiaoGe(1, "百战牌鼠标", "BZ_001", 99.21, 0.9);
        BiaoGe op1 = new BiaoGe(2, "键盘侠玩偶", "WO_102", 403, 0.7);
        BiaoGe op2 = new BiaoGe(3, "实战java程序设计", "BK_001", 89.00, 0.8);
        BiaoGe op3 = new BiaoGe(4, "蔡幸牌西装", "GQ_XF_12", 700, 0.5);
        BiaoGe op4 = new BiaoGe(5, "大米牌手机", "DM_PH_13", 900, 0.3);

        BiaoGe[] ops =new BiaoGe[5];
        ops[0]=op0;
        ops[1]=op1;
        ops[2]=op2;
        ops[3]=op3;
        ops[4]=op4;
        for (int a=0;a<ops.length;a++){
            System.out.println(ops[a].getId()+"\t"+ops[a].getName()+"\t"+ops[a].getModelNumber()+"\t"+ops[a].getPrice()+"\t"+ops[a].getDiscount());
        }

        System.out.println("下面是静态初始化");
        BiaoGe[] ops1={op0,op1,op2,op3,op4};
        for (int b=0;b<ops.length;b++){
            System.out.println(ops1[b].getId()+"\t"+ops1[b].getName()+"\t"+ops1[b].getModelNumber()+"\t"+ops1[b].getPrice()+"\t"+ops1[b].getDiscount());
        }

        //在创建一个方法,遍历改写toString()方法打印;

        System.out.println("在创建一个方法,遍历改写toString()方法打印;");
        BiaoGe[] s1 ={op0,op1,op2,op3,op4};
        for (int i=0;i< s1.length;i++) {
            System.out.println(s1[i]);
        }


    }
}

    class BiaoGe{
        private int id;
        private String name;
        private String ModelNumber;
        private double price;
        private double discount;


        BiaoGe(){

        }


        public BiaoGe(int id, String name, String modelNumber, double price, double discount) {
            this.id = id;
            this.name = name;
            this.ModelNumber = modelNumber;
            this.price = price;
            this.discount = discount;

        }

        @Override
        public String toString() {
            return "ID:"+id+"\t名称:"+name+"\t 型号:"+ModelNumber+"\t价格:"+price+"\t折扣"+discount;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getModelNumber() {
            return ModelNumber;
        }

        public void setModelNumber(String modelNumber) {
            ModelNumber = modelNumber;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public double getDiscount() {
            return discount;
        }

        public void setDiscount(double discount) {
            this.discount = discount;
        }
    }

一维数组怎么用嵌套循环打印?????写了半天发现打出来不对,,,,空白

JAVA 全系列/第一阶段:JAVA 快速入门/数组和数据存储 27599楼
WEB前端全系列/第十九阶段:Vue2知识体系(旧)/Vue基础知识 27600楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637