当前位置:网站首页>牛客网专项练习(八)——选择题(错题&不懂的题)
牛客网专项练习(八)——选择题(错题&不懂的题)
2021-09-15 05:02:14 【程序员大本营】
分析:这里不是this调用语句,应该是this()。
1. 构造器中第一行默认是super(),如果直接父类中没有无参构造方法,那么必须显式调用父类的某个有参构造方法。
2. 构造器中第一行的super()可以换成this(),但是this()和super()只能出现一个。
3. super,this关键字与super(),this()不是一个概念,前者表示当前调用者的父类与其本身,后者是为了构造器相互调用。
分析:这里考的是值传递和引用传递。
值传递,只在该方法内有效,所以var2指向不发生改变,它的值还是1,var1和var2指向的还是堆当中Integer1。
分析:servlet处于服务器进程中,它通过多线程方式运行其service()方法,一个实例可以服务于多个请求,并且其实例一般不会销毁;
而CGI对每个请求都产生新的进程,服务完成之后就进行销毁,故在效率上低于servlet。
CGI不可移植,为某一特定平台编写的CGI应用只能运行于这一环境中。每一个CGI应用存在于一个由客户端请求**的进程中,并且在请求被服务后被卸载。
分析:额做完之后才发现被坑爹了,String里面压根没有decode()和encode()这两个方法。
其实就是先解码再编码。
new String(src,"GBK")解码得到字符串;
getBytes("UTF-8")得到UTF8编码字节数组。
分析:Integer和Long类型之间不能进行比较。
包装类都重写了equals()方法,所以比较值,都是相等的。
分析:声明异常用的是throws关键字;
抛出异常用的是throw关键字,throw new Exception("自定义异常");
try是用于检测被包住的语句块是否出现异常,如果有异常,则进行抛出,用的是throw关键字,并执行catch语句。
分析:在局部内部类的方法中,要求方法的局部变量必须声明为final的。
jdk 7及之前版本:要求此局部变量显式的声明为final的。
jdk 8及之后的版本:可以省略final的声明。内部类分为成员内部类和局部内部类,成员内部类在外部类的内部,可以直接调用外部类的静态方法和非静态方法。
匿名内部类和和局部内部类的用法不一样,最显著的区别就是匿名内部类只能使用一次。
D、静态内部类不能直接访问外部类的非静态成员,但是可以通过new外部类().非静态成员的方式访问。
分析:C选项,两个遍历方式的内部实现有些不同。
Hashtable、HashMap都使用了 Iterator。但是Hashtable还使用了Enumeration的方式 。
分析:A和D肯定是对的
其次对于B选项,数组命名时名称与[ ]可以随意排列。所以B也正确。
E选项,在声明二维数组时,第一个中括号中必须要有值,因为它代表的是在该二维数组中有多少个一维数组,而第二个中括号可以先不写。
版权声明
本文为[程序员大本营]所创,转载请带上原文链接,感谢
https://www.pianshen.com/article/38922093579/
边栏推荐
- Drive module company records
- The revival of technological minimalism
- How to use cqrs to effectively cut the code base according to business functions?
- Lemmy - link aggregator of the federal universe
- Why is reddit so slow and unreliable| HackerNews
- DDD current engineering method portfolio - Kamil
- Supprimer l'avant - dernier noeud de la liste liée
- Septembre 2021 liste des bases de données nationales - Mo Tianlun: Dream poursuit oceanbase, opengauss anti - Super polardb à un autre niveau
- 直击 2021 苹果秋季发布会:iPhone 13 全系降价,苹果彻底放大招?
- Tous les votes!Le projet Open source de weizhong linkis entre dans l'incubation Apache
猜你喜欢
-
Coinbase fell after disclosing regulatory inquiries about loan products
-
直擊 2021 蘋果秋季發布會:iPhone 13 全系降價,蘋果徹底放大招?
-
Cliquez directement sur le lancement d'automne 2021 d'Apple: iPhone 13 réduit les prix de l'ensemble de la gamme, Apple agrandit complètement le mouvement?
-
Web vulnerability - SQL
-
Tom Cat received the attention letter from Shenzhen Stock Exchange: explain the relevance between the main products and the concept of meta universe
-
推荐一款写数学公式的神器。
-
Échelle élastique personnalisée de l'autoscaler knative
-
Ruishu information completed the C2 round of 300 million yuan financing and released new data security products
-
How to automate security compliance using kubernetes?
-
Recommande un artefact pour écrire des formules mathématiques.
随机推荐
- If the "Maginot defense line" fails, how to do a good job in container cloud security?
- Tdsql-a makes every effort to meet the needs of massive data real-time analysis
- Word document recovery software recommendations
- [cjson] cjson learning notes (II)
- [Questions d'entrevue à haute fréquence] À vous de choisir
- 企业级项目实战讲解,我总结了所有面试题,
- 字节跳动历年Android中高级面试题全收录,算法 分布式 微服务
- 字节跳动上千道精选面试题还不刷起来,webrtc音视频开发
- Pénétration du cache et Avalanche du cache
- Can I save multiple product SKU pictures on pinduoduo by computer?
- VIM configuring C + + development environment win10
- 字節跳動上千道精選面試題還不刷起來,webrtc音視頻開發
- Des milliers de questions d'entrevue sélectionnées n'ont pas encore ét é effacées.
- Les questions d'entrevue de niveau intermédiaire et avancé d'Android au fil des ans sont entièrement incluses, et l'algorithme est distribué microservice
- J'ai résumé toutes les questions d'entrevue.
- 字節跳動曆年Android中高級面試題全收錄,算法 分布式 微服務
- 【项目管理/PMP/PMBOK第六版/新考纲】纯干货!敏捷型/Stacey矩阵/vuca/敏捷宣言/冲刺/产品负责人/敏捷团队/敏捷教练/待办事项列表/迭代任务列表/可交付产品增量
- solid works绘制航模发动机
- 爬虫
- Capacity of the Gaussian Two-Way Relay Channel to Within 1/2 Bit
- 分布式session解决方案原理
- PID调节原理分析
- 论文阅读23 - Mixture Density Networks(MDN)混合密度网络理论分析
- 《信号与系统》解读 第1章 信号与系统概述-3:基本的1阶信号--单位阶跃信号、单位斜变信号、单位冲击信号
- 过拟合和欠拟合的区别
- solid works繪制航模發動機
- 【項目管理/PMP/PMBOK第六版/新考綱】純幹貨!敏捷型/Stacey矩陣/vuca/敏捷宣言/沖刺/產品負責人/敏捷團隊/敏捷教練/待辦事項列錶/迭代任務列錶/可交付產品增量
- Solid Works Drawing airmodel Engine
- [Project Management / PMP / PMBOK 6th Edition / New text Guide] pure Dry goods!Matrice agile / Stacey / vuca / manifeste agile / sprint / chef de produit / équipe agile / entraîneur agile / liste de tâches / liste de tâches itérative / incréments de produ
- Recherche de l'optimalité, problème et pratique de la résolution des contraintes pour les Wavelets | y compris le téléchargement de rapports
- Mitsubishi Outlander has obtained the highest safety choice + rating of IIHS in the United States, which is specially applicable to the gasoline version
- Full resolution of hystrix configuration parameters
- The second blog, novice on the road, intensive training is very rich
- 2017/7/9
- Web vulnerability - SQL
- 論文閱讀23 - Mixture Density Networks(MDN)混合密度網絡理論分析
- Lecture de l'article 23 - analyse théorique des réseaux de densité mixte (MDN)
- Analyse du principe de régulation PID
- Principes de la solution de session distribuée
- Capacity of the gaussien two way relay Channel to within 1 / 2 bit