2023/01/05 java面试题每日10问

news2024/11/24 0:17:28

1.What is Java?

  • Java is object-oriented, platform-independent, Multithreaded, and portable programming language.
  • it provides its own JRE and API.

2.What is the difference between JDK, JRE, and JVM?

在这里插入图片描述
JVM

  • Java Virtual Machine provides the runtime environment
  • JVM converts Java bytecode into machine language

JRE

  • Java Runtime Environment make java program to run
  • It contains the class libraries, loader class, and JVM.
  • JRE provide the runtime environment.

JDK

  • Java Development Kit contains tools can write Java programs and JRE to execute them.
  • It includes a compiler, Java application launcher
  • JDK includ JRE and JVM

3. What is Object-Oriented?

  • object-oriented programming is about creating objects that contain both data and methods.
  • advantages
    • OOP is faster and easier to execute
    • we don’t need to repeat
    • The code easier to maintain, modify and debug
    • OOP can reuse before code and reduce development time

4. what is Multithreaded?

  • programs can deal with many tasks at once
  • programs doesn’t occupy memory for each thread and share a common memory area.

5.What are the various access specifiers in Java?

  • access specifiers are used to define the access scope of the method, class, or a variable
    Public
    The classes, methods, or variables are defined as public,
    it can be accessed by any class or method.
    Protected
    Protected can be accessed by the class of the same package, or by the sub-class of this class, or within the same class.
    Default
    Default are accessible within the package only.
    Private
    private can be accessed within the class only.

6. What is the purpose of static methods and variables?

  • The methods or variables defined as static are shared among all the objects of the class. - The static is the part of the class and not of the object.
  • The static variables are stored in the class area, and we do not need to create the object to access such variables.

7. What are the advantages of Packages in Java?

  1. Packages avoid the name clashes.
  2. The Package provides easier access control.
  3. We can also have the hidden classes that are not visible outside and used by the package.
  4. It is easier to locate the related classes.

8. What is an object?

  • Java object is a member (instance) of a Java class
  • Each object has an identity, a behavior and a state.
  • The state of the object is stored in fields (variables), methods (functions) display the object’s behavior.
  • In Java, an object is created using the keyword “new”.

9.What is the difference between an object-oriented programming language and object-based programming language?

Object Based Languages

  • Object based languages supports the usage of object and encapsulation.
  • They does not support inheritance or, polymorphism or, both.
  • Object based languages does not supports built-in objects.
  • Javascript, VB are the examples of object bases languages.
    Object Oriented Languages
  • Object Oriented Languages supports all the features of Oops including inheritance and - polymorphism.
  • They support built-in objects.
  • C#, Java, VB. Net are the examples of object oriented languages.

10.What is the constructor?

  • The constructor is special method that is used to initialize the object.
  • It is invoked when the class is instantiated, and the memory is allocated for the object.
  • Every time, an object is created using the new keyword, the default constructor of the class is called.
  • The name of the constructor must be similar to the class name.
  • The constructor must not have an explicit return type.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/144436.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

小小闭门会,揭示SaaS大趋势

从2014年中国的SaaS领域开始有融资到现在已经8年,从最开始的一张云图填不满到现在的密密麻麻,厂商和产品如雨后春笋般的多了起来,但很多SaaS依然在孤军奋战,很多厂商陷入定制化泥潭。有人说中国的SaaS有特殊国情,大企业…

【bioinfo】酶切法片段化建库相比超声打断建库引入softclip使用FADE软件识别/去除

FADE软件参考文献 参考文献:片段化酶诱导的双链伪影的表征和缓解 - PMC (nih.gov) 文献提供的酶切产生的错误识别和去除软件FADE:软件git地址 文献补充材料图:由酶切产生的人工错误序列的碱基质量值偏高,相对其他softclip的质量…

适配Dell R750xs server Broadcom BCM57412 NetXtreme-E 10Gb SFP+ 网卡

摘要 The Issue is to handle Scaler v8.2-385 (baf7f3a) on Dell R750xs server, the 10G NIC card is Broadcom BCM57412 NetXtreme-E 10Gb SFP. Firmware is the latest, but driver is not. The symptom is that only one port or no port could be recognized. After patc…

基于MAX7800羽毛板语音控制ESP8266小车

1. 项目介绍 基于MAX7800羽毛板语音控制ESP8266小车 采用现成的KWS20关键词,[up, down, left, right, stop, go, yes, no, on, off, one, two, three, four, five, six, seven, eight, nine, zero],进行语音关键字识别远程控制小车。 2. 项目设计思路 搭…

JSP——EL表达式

✅作者简介:热爱国学的Java后端开发者,修心和技术同步精进。 🍎个人主页:Java Fans的博客 🍊个人信条:不迁怒,不贰过。小知识,大智慧。 💞当前专栏:JAVA开发者…

年度征文 | 回顾2022,展望2023 (清风与我)

个人简介: 名称内容个人主页清风与我学习方向主攻前端方向推荐学习vue,vue3,node.js,React,项目实战推荐学习用网站菜鸟教程,博客,哔哩哔哩 …学习用资源网vue,element,…

Apollo星火计划学习笔记——Apollo开放空间规划算法原理与实践

文章目录1. 开放空间规划算法总体介绍1.1 Task: OPEN_SPACE_ROI_DECIDER1.2 Task: OPEN_SPACE_TRAJECTORY_PROVIDER1.3 Task: OPEN_SPACE_TRAJECTORY_PARTITION1.4 Task: OPEN_SPACE_FALLBACK_DECIDER2. 基于混合A *的路径规划算法2.1 hybrid A*的简要思想2.2 RS曲线2.3 Apollo…

一文读懂方壳电池仓段差缺陷检测

摩根大通预计,2025年中国新能源汽车渗透率将达46.3%,彭博新能源财经最新发布的《新能源汽车市场长期展望》(EVO)报告显示,到2025年底,新能源汽车保有量将达到7700万辆,不难看出新能源行业依旧前景广阔。围绕“新能源”…

JDBC(Java Database connect)详解

一、相关概念 什么是JDBC JDBC(Java Data Base Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问,它由一组用Java语言编写的类和接口组成。JDBC提供了一种基准,据此可…

软件测试门槛低么?适合初学者么

随着软件工程活动的不断演化,软件测试工作已经成为了不可或缺的一部分,测试工作某种程度上是可以很大幅度提高软件的产品质量以及提升用户的使用满意度。因此,许多想要学习软件测试的朋友也许常常会有这样的困惑,软件测试门槛低吗…

JS数组对象——根据日期进行排序Date.parse(),按照时间进行升序或降序排序localeCompare()

JS数组对象——根据日期对象进行排序,按照时间进行升序或降序排序场景复现封装数组对象的排序方法根据日期和时间对象排序1、按照日期时间混合排序2、分别按照日期和时间进行排序场景复现 排序在项目中非常实用,出现频率极高,尤其是后台管理…

用javascript分类刷leetcode17.栈(图文视频讲解)

目录 Stack的特点:先进后出(FILO) 使用场景:十进制转2进制 函数调用堆栈 js里没有栈,但是可以用数组模拟 42/2 42%20 21/2 21%21 10/2 10%20 5/2 5%21 2/2 2%20 1/2 1%21 stack: [0,1,0,1,0,1] res: 1 0 1 …

VC#复习资料

一、选择题 2、“闪电”图标 3、using命名空间 命名空间的设计目的是提供一种让一组名称与其他名称分隔开的方式,using 关键字表明程序使用的是给定命名空间中的名称,使用 using 命名空间指令,这样在使用的时候就不用在前面加上命名空间名称…

golang学习

由于期末考试没时间学算法学了一波go放松一下 这可能是我学语言最认真的一次了( 跟的是尚硅谷学完的 二倍速快进 折腾了一周左右 网络编程部分没看 因为不懂计网 不想学( 虽然已经很老的课了 但是顺平老师雀氏讲的太细了也是听完了自己也没时间写笔记 …

QT5.14.2编译mysql-5.7.25 32位驱动办法

开发环境:Windows10QT5.14.2MySQL5.7.25 编译步骤: 1、下载安装mysql压缩包,下载地址为:https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.25-win32.zip 也可以打开MySQL :: Download MySQL Community Server (Archived Ve…

Electron主进程渲染进程间通信的四种方式

在electron中进程使用 ipcMain 和 ipcRenderer 模块,通过开发人员定义的“通道”传递消息来进行通信。新的版本中electron推荐使用上下文隔离渲染器进程进行通信,这种方式的好处是无需在渲染进程中直接使用ipcRenderer发送消息,这种在渲染进程…

JWT令牌入门

上篇文章我们写了如何登录,我们着重学习Token模式下的单点登录 一、访问令牌的类型 透明令牌,是客户端存储一段引用数字,然后到达服务器指向服务器中特定的令牌 类似于,cookie中存储了sessionId他们之间的关系 自包含令牌&#x…

猿代码超算实习生,五步助力拿到高薪offer

虽说行行出状元,但是一旦入错行,那就是一辈子的事。互联网的潮水已经退去,普通人再进入也只是勉强温饱。与其朝不保夕的被裁员,倒不如提前锁定未来30年的幸福。 20大以来,芯片国产化、超算(先进计算&#…

docker的run,cmd,entrypoint分析和对比

写在前面 本文一起看下Dockerfile中经常用到的几个类似命令,RUN,CMD,ENTRYPOINT。 1:容器是怎么来的? 想要有容器我们就必须先创建镜像,而想要有镜像,我们则必须写一个用来描述想要创建的镜像…

Struts2基本架构

Struts2基本架构1、Struts2执行流程2、web.xml配置3、Action控制器3.1、核心控制器3.2、业务控制器4、Result配置5、struts.xml核心配置5.1、constant元素5.2、package元素5.3、配置文件加载顺序1、Struts2执行流程 如下例子: 执行流程如下: 浏览器将请…