会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133800个问题

package integre.fang.com;
/**
 * 自己手写得包装类
 *
 * */
public class MyInteger01 {
    private int value;
    public static final int LOW=-128;
    public static final int HIGH=127;
    private static MyInteger01[] myInteger01;

    static {
        for (int i=LOW;i<=HIGH;i++){
          myInteger01[i+128]=MyInteger01.getMyinteger(i);//核心得点在这里,有点迷糊
        }
    }

    public  MyInteger01(int a) {
        this.value = a;
    }

    public static MyInteger01 getMyinteger(int a){
        if (LOW<=a && a<=HIGH){
            return myInteger01[a+128];
        }
            return new MyInteger01(a);

    }

    public static void main(String[] args) {
        int a=100;
        int b=100;
        MyInteger01 m1=new MyInteger01(300);
        MyInteger01 m2=new MyInteger01(300);
        MyInteger01 m3=new MyInteger01(100);
        MyInteger01 m4=new MyInteger01(100);
        System.out.println(m1==m2);
        System.out.println(m3==m4);
        //System.out.println(MyInteger01.getMyinteger(a)==MyInteger01.getMyinteger(b));
        //System.out.println(MyInteger01.getMyinteger(a).equals(MyInteger01.getMyinteger(b)));

        int c=1000;
        int d=1000;
        //System.out.println(MyInteger01.getMyinteger(c)==MyInteger01.getMyinteger(d));
        //System.out.println(MyInteger01.getMyinteger(c).equals(MyInteger01.getMyinteger(d)));
    }

}

Exception in thread "main" java.lang.ExceptionInInitializerError

老师帮忙看看哪里出错了?

JAVA 全系列/第二阶段:JAVA 基础深化和提高/常用类 11836楼
Python 全系列/第二阶段:Python 深入与提高/模块 11837楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/多线程技术(旧) 11838楼
JAVA 全系列/第四阶段:数据库与AI协同技术实战/JDBC技术 11839楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/多线程技术 11841楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/飞机大战小项目训练 11842楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/变量、数据类型、运算符 11843楼
JAVA 全系列/第四阶段:数据库与AI协同技术实战/JDBC技术 11844楼

image.png

Python 全系列/第二阶段:Python 深入与提高/文件处理 11845楼
Python 全系列/第一阶段:AI驱动的Python编程/面向对象 11846楼
Python 全系列/第一阶段:AI驱动的Python编程/序列 11847楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <style>
        *{
            margin: 0;
        }
        .box{
            width: 1263px;
            height: 750px;
            /*background: red;*/
        }
        .wrap{
            width: 25%;
            height: 375px;
            /*background: blue;*/
            float: left;
            padding: 10px;
            box-sizing: border-box;
            position: relative;
        }
        .items>img{
            width: 100%;
            height: 100%;
        }
        .items-name{
            position: absolute;
            top: 265px;
            left:25px;
        }
        .items-name1{
            left:90px;
        }
        .items-information{
            position: absolute;
            top: 300px;
            left:40px;
        }
        .items-information1{
            left:25px;
        }
        .items-price{
            position: absolute;
            top: 310px;
            left:100px;
        }
        .box-p{
            width: 303px;
            height: 80px;
        }
        .box-p>p:first-of-type{
            color: #333333;
            font-size: 16px;
            margin-top: 1px;
        }
        .box-p>p:nth-child(2){
            font-size: 14px;
            color: #999999;
        }
        .box-p>p:last-of-type{
            font-size: 22px;
            color: #cc0000;
        }
        span{
            color: #999999;
            font-size: 12px;
        }
        .items:hover{
            box-shadow: 0 10px 10px rgba(0,0,0,.18);
            /*transform: scale(1.1);*/
        }
        .circle{
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(to bottom right,hotpink,pink);
            position: absolute;
            top: 20px;
            left: 20px;
            line-height: 50px;
        }
    /*    移动端*/
        @media screen and (max-width: 768px) {
            .wrap{
                width: 50%;
            }
        }
    /*    Ipad端*/
        @media screen and(max-width: 992px) and (min-width: 768px){
            .wrap{
                width: 33%;
            }
        }
    /*    pc端*/
        @media screen and (min-width: 992px){
            .wrap{
                width: 25%;
            }
        }
    </style>
</head>
<body>
 <div class="box">
     <div class="wrap">
         <div class="items">
             <img src="魅族images/be6fed05-168e-4633-bc1d-6e75705fce07.jpg" alt="">
             <p class="items-name" style="font-size: 21px;font-weight: 700;color: #ffffff">魅族 HD60 头戴式蓝牙耳机</p>
             <p class="items-information" style="color: #ffffff;font-size: 14px">40mm生物振膜 | 触控操作 | 蓝牙5.0</p>
             <p class="items-price" style="font-size: 24px;font-weight: 700;color:gold">¥499</p>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/08/5E/Cgbj0V_38NOAGvEXAAN6WGRLi3Y197.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 POP Pro 主动降噪耳机</p>
                 <p>【限时特惠449元+3期免息】</p>
                 <p>¥449 <span><small><del>¥499</del></small></span></p>
             </div>
         </div>
         <div class="circle" style="color: white;text-align: center">
         <p>免息</p>
     </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/08/40/Cgbj0V-JCMSAa5qBAAMth2Y6_gU978.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 POP2s 真无线耳机</p>
                 <p>【限时特惠199元+3期免息】</p>
                 <p>¥199 <span><small><del>¥299</del></small></span></p>
             </div>
         </div>
         <div class="circle" style="color: white;text-align: center">
             <p>免息</p>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/07/2F/Cgbj0Vy_C3GAN_TKAAExaPfTwFc180.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 HIFI 解码耳放</p>
                 <p>【限时特惠149元】</p>
                 <p>¥149 <span><small><del>¥169</del></small></span></p>
             </div>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://fms.res.meizu.com/dms/2019/08/29/04811a8d-07fb-4188-a852-1971f442d08f.jpg" alt="">
             <p class="items-name items-name1" style="font-size: 21px;font-weight: 700;color: #ffffff">魅族 EP3C 耳机</p>
             <p class="items-information items-information1" style="color: #ffffff;font-size: 14px">Hi-Res 认证高解析音质 | Type-C数字接口</p>
             <p class="items-price" style="font-size: 24px;font-weight: 700;color:gold">¥
                 129</p>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/07/E0/Cgbj0V6z8VSAV6kEAAlCc-omYno614.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 HD60 降噪耳机</p>
                 <p>【限时特惠799元+12期免息】</p>
                 <p>¥799 <span><small><del>¥1099</del></small></span></p>
             </div>
         </div>
         <div class="circle" style="color: white;text-align: center">
             <p>免息</p>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/07/86/Cgbj0V3UocyAR_tJAApbDmCAyEo620.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 HD60 头戴式蓝牙耳机</p>
                 <p>40mm生物振膜 | 触控操作 | 蓝牙5.0</p>
                 <p>¥449</p>
             </div>
         </div>
     </div>
     <div class="wrap">
         <div class="items">
             <img src="https://openfile.meizu.com/group1/M00/04/17/Cgbj0VrcX6yABHxPAARZwWUAjc4748.png" alt="">
             <div class="box-p" align="center">
                 <p>魅族 HALO 激光蓝牙耳机</p>
                 <p>炫酷夜跑神器 随性张扬</p>
                 <p>¥449 <span><small><del>¥999</del></small></span></p>
             </div>
         </div>
     </div>
 </div>
</body>
</html>

我为什么缩小到移动端的时候,图片并没有变小,感觉所有的格式都乱了呢,还有就是并没有按相应该显示的几个

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS盒子模型 11848楼
JAVA 全系列/第八阶段:生产环境部署与协同开发/ShellScript脚本编程 11850楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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