文章目录try-catch的使用以及细节1.基本语法2.注意细节快捷键try-catch的使用以及细节🎈Java中提供try和catch块来处理异常。try块用于包含可能出错的代码。catch块用于处理try块中发生的异常。可以根据需要在程序中有多个try…catch块。1.基本语法try{//可疑代码//将异常生成对象的异常对象传递给catch块}catch(异常){//对异常进行处理}finally{}//可以没有finally2.注意细节如果异常发生了,则异常发生后面的代码不会执行,直接进入到catch块如果异常没有发生,则顺序执行try的代码块,不会进入到catch如果希望发不发生异常
使用新版burp时出现AJNIerrorhasoccurred,pleasecheckyourinstallationandtryagain在bp路径下按住shift点击鼠标右键打开powershell然后输入命令java-jarburpsuite_pro_v2021.5.1.jar出现如下报错信息Error:AJNIerrorhasoccurred,pleasecheckyourinstallationandtryagainExceptioninthread“main”java.lang.UnsupportedClassVersionError:burp/StartBurphasbeenco
使用新版burp时出现AJNIerrorhasoccurred,pleasecheckyourinstallationandtryagain在bp路径下按住shift点击鼠标右键打开powershell然后输入命令java-jarburpsuite_pro_v2021.5.1.jar出现如下报错信息Error:AJNIerrorhasoccurred,pleasecheckyourinstallationandtryagainExceptioninthread“main”java.lang.UnsupportedClassVersionError:burp/StartBurphasbeenco
SomethinkthemetaverseistheobjectiveofthefutureInternetandanotherrevolutionininformationtechnology,whileothersmerelyconsideritaPonzischeme.Whileametaversemaybeinitsearlyphasesofdevelopment,manyofitsbasiccomponentsarealreadyinplace.Theyhaveeffectivelysupportedtheintegrationoftechnologiessuchasaugmente
SomethinkthemetaverseistheobjectiveofthefutureInternetandanotherrevolutionininformationtechnology,whileothersmerelyconsideritaPonzischeme.Whileametaversemaybeinitsearlyphasesofdevelopment,manyofitsbasiccomponentsarealreadyinplace.Theyhaveeffectivelysupportedtheintegrationoftechnologiessuchasaugmente
1.Static详情见下面代码讲解点击查看代码packagecom.Tang.oop.demo07;publicclassStudent{privatestaticintage;//静态变量privatedoublescore;//非静态变量publicvoidrun(){go();//非静态方法可以调用静态方法}publicstaticvoidgo(){}publicstaticvoidmain(String[]args){Students1=newStudent();System.out.println(Student.age);//静态变量可以被类中的所有实例去共享//System.ou
1.Static详情见下面代码讲解点击查看代码packagecom.Tang.oop.demo07;publicclassStudent{privatestaticintage;//静态变量privatedoublescore;//非静态变量publicvoidrun(){go();//非静态方法可以调用静态方法}publicstaticvoidgo(){}publicstaticvoidmain(String[]args){Students1=newStudent();System.out.println(Student.age);//静态变量可以被类中的所有实例去共享//System.ou
下面代码/***读取文件到byte数组**@paramtradeFile*@return*/publicstaticbyte[]file2byte(FiletradeFile){try{FileInputStreamfis=newFileInputStream(tradeFile);ByteArrayOutputStreambos=newByteArrayOutputStream();byte[]b=newbyte[1024];intn;while((n=fis.read(b))!=-1){bos.write(b,0,n);}fis.close();bos.close();byte[]bu
下面代码/***读取文件到byte数组**@paramtradeFile*@return*/publicstaticbyte[]file2byte(FiletradeFile){try{FileInputStreamfis=newFileInputStream(tradeFile);ByteArrayOutputStreambos=newByteArrayOutputStream();byte[]b=newbyte[1024];intn;while((n=fis.read(b))!=-1){bos.write(b,0,n);}fis.close();bos.close();byte[]bu
final实现原理简介final关键字,实际的含义就一句话,不可改变。什么是不可改变?就是初始化完成之后就不能再做任何的修改,修饰成员变量的时候,成员变量变成一个常数;修饰方法的时候,方法不允许被重写;修饰类的时候,类不允许被继承;修饰参数列表的时候,入参的对象也是不可以改变。这个就是不可变,无论是引用新的对象,重写还是继承,都是改变的方法,而final就是把这个变更的路给堵死用法final修饰变量final成员变量表示常量,只能被赋值一次,赋值后值不再改变(final要求地址值不能改变)当final修饰一个基本数据类型时,表示该基本数据类型的值一旦在初始化后便不能发生变化;如果final修饰