Core Java Interview Questions- Part 3

120+ Core Java Interview Questions and Answers part3

[fusion_builder_container type=”flex” hundred_percent=”no” hundred_percent_height=”no” min_height=”” hundred_percent_height_scroll=”no” align_content=”stretch” flex_align_items=”flex-start” flex_justify_content=”flex-start” flex_column_spacing=”” hundred_percent_height_center_content=”yes” equal_height_columns=”no” container_tag=”div” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” margin_top_medium=”” margin_bottom_medium=”” margin_top_small=”” margin_bottom_small=”” margin_top=”0px” margin_bottom=”” padding_top_medium=”” padding_right_medium=”” padding_bottom_medium=”” padding_left_medium=”” padding_top_small=”” padding_right_small=”” padding_bottom_small=”” padding_left_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” link_color=”” link_hover_color=”” border_sizes_top=”” border_sizes_right=”” border_sizes_bottom=”” border_sizes_left=”” border_color=”” border_style=”solid” box_shadow=”no” box_shadow_vertical=”” box_shadow_horizontal=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” z_index=”” overflow=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ background_blend_mode=”none” video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” render_logics=”” absolute=”off” absolute_devices=”small,medium,large” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_background_color=”” sticky_height=”” sticky_offset=”” sticky_transition_offset=”0″ scroll_offset=”0″ animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ align_self=”auto” content_layout=”column” align_content=”flex-start” valign_content=”flex-start” content_wrap=”wrap” spacing=”” center_content=”no” link=”” target=”_self” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” type_medium=”” type_small=”” order_medium=”0″ order_small=”0″ dimension_spacing_medium=”” dimension_spacing_small=”” dimension_spacing=”” dimension_margin_medium=”” dimension_margin_small=”” margin_top=”” margin_bottom=”” padding_medium=”” padding_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” hover_type=”none” border_sizes=”” border_color=”” border_style=”solid” border_radius=”” box_shadow=”no” dimension_box_shadow=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” background_type=”single” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_color=”” background_image=”” background_image_id=”” background_position=”left top” background_repeat=”no-repeat” background_blend_mode=”none” render_logics=”” filter_type=”regular” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” last=”true” border_position=”all” first=”true”][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”default” rule_size=”” rule_color=”” content_alignment_medium=”” content_alignment_small=”” content_alignment=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” margin_top=”” margin_right=”” margin_bottom=”” margin_left=”” font_size=”” fusion_font_family_text_font=”” fusion_font_variant_text_font=”” line_height=”” letter_spacing=”” text_color=”” animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=””]

Core Java Interview Questions- Part 3Java’s popularity is beyond measurement. It has been persistently ranked among the top programming languages in TTYL and various other industry surveys and is considered one of the most globally used programming languages. Thus, learning Core Java can open up a wide range of career opportunities in software development.

Learning Core Java is an excellent investment for anyone who wants to pursue a career in software and web development, as it provides a strong foundation for building a variety of applications and systems.

To succeed in a Core Java interview, you must prepare common technical interview questions and enhance your hands-on practical skills. Here are the most asked Core Java interview questions to help you ace your next Core Java interview:

[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container type=”flex” hundred_percent=”no” hundred_percent_height=”no” min_height=”” hundred_percent_height_scroll=”no” align_content=”stretch” flex_align_items=”flex-start” flex_justify_content=”flex-start” flex_column_spacing=”” hundred_percent_height_center_content=”yes” equal_height_columns=”no” container_tag=”div” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” margin_top_medium=”” margin_bottom_medium=”” margin_top_small=”” margin_bottom_small=”” margin_top=”” margin_bottom=”” padding_top_medium=”” padding_right_medium=”” padding_bottom_medium=”” padding_left_medium=”” padding_top_small=”” padding_right_small=”” padding_bottom_small=”” padding_left_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” link_color=”” link_hover_color=”” border_sizes_top=”10px” border_sizes_right=”10px” border_sizes_bottom=”10px” border_sizes_left=”10px” border_color=”#007dc6″ border_style=”solid” box_shadow=”yes” box_shadow_vertical=”4″ box_shadow_horizontal=”4″ box_shadow_blur=”30″ box_shadow_spread=”0″ box_shadow_color=”rgba(0,0,0,0.32)” box_shadow_style=”” z_index=”” overflow=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_color=”” background_image=”” background_position=”center center” background_repeat=”no-repeat” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ background_blend_mode=”none” video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” render_logics=”” absolute=”off” absolute_devices=”small,medium,large” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_background_color=”” sticky_height=”” sticky_offset=”” sticky_transition_offset=”0″ scroll_offset=”0″ animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″][fusion_builder_row][fusion_builder_column type=”1_1″ layout=”1_1″ align_self=”auto” content_layout=”column” align_content=”flex-start” valign_content=”flex-start” content_wrap=”wrap” spacing=”” center_content=”no” link=”” target=”_self” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” background_image_id=”” type_medium=”” type_small=”” order_medium=”0″ order_small=”0″ spacing_left_medium=”” spacing_right_medium=”” spacing_left_small=”” spacing_right_small=”” spacing_left=”” spacing_right=”” margin_top_medium=”” margin_bottom_medium=”” margin_top_small=”” margin_bottom_small=”” margin_top=”” margin_bottom=”” padding_top_medium=”” padding_right_medium=”” padding_bottom_medium=”” padding_left_medium=”” padding_top_small=”” padding_right_small=”” padding_bottom_small=”” padding_left_small=”” padding_top=”20px” padding_right=”20px” padding_bottom=”20px” padding_left=”20px” hover_type=”none” border_sizes_top=”” border_sizes_right=”” border_sizes_bottom=”” border_sizes_left=”” border_color=”” border_style=”solid” border_radius_top_left=”” border_radius_top_right=”” border_radius_bottom_right=”” border_radius_bottom_left=”” box_shadow=”no” box_shadow_vertical=”” box_shadow_horizontal=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” background_type=”single” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_color=”” background_image=”” background_position=”left top” background_repeat=”no-repeat” background_blend_mode=”none” render_logics=”” filter_type=”regular” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ animation_type=”” animation_direction=”left” animation_speed=”0.3″ animation_offset=”” last=”true” border_position=”all” first=”true”][fusion_accordion type=”accordions” boxed_mode=”” border_size=”1″ border_color=”” background_color=”” hover_color=”” divider_line=”” title_font_size=”” icon_size=”” icon_color=”” icon_boxed_mode=”” icon_box_color=”#4f4f4f” icon_alignment=”right” toggle_hover_accent_color=”#3ed9df” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”interview_list” id=””][fusion_toggle title=”Question 41: What is RMI?” open=”no” class=”” id=””]

Answer:

RMI or Remote Method Invocation is a mechanism to create the distributed Java applications. RMI allows an object to access & invoke methods on an object running on another system or JVM.

[/fusion_toggle][fusion_toggle title=”Question 42: What is multithreading feature in Java?” open=”no” class=”” id=””]

Answer:

In Java, Multithreading is a process of executing multiple threads at the same time for maximum utilization of the CPU. A thread in Java is a lightweight process requiring fewer resources to create and share the process resources.

[/fusion_toggle][fusion_toggle title=”Question 43: What is daemon thread?” open=”no” class=”” id=””]

Answer:

A daemon thread is the low priority thread that provides background services & support to the user threads. It gets automatically terminated by the Java Virtual Machine if the program only remains with the daemon thread, and all the other user threads are ended or dead.

[/fusion_toggle][fusion_toggle title=”Question 44: What is Thread Scheduler in Java?” open=”no” class=”” id=””]

Answer:

In Java, Thread Scheduler is the component of Java Virtual Machine that determines the execution order of multiple threads on a single processor. It decides the order in which threads should run and the process is called thread scheduling in Java.

[/fusion_toggle][fusion_toggle title=”Question 45: What is the ”volatile keyword” in Java?” open=”no” class=”” id=””]

Answer:

In Java, Multithreading is a process of executing multiple threads at the same time for maximum utilization of the CPU. A thread in Java is a lightweight process requiring fewer resources to create and share the process resources.

[/fusion_toggle][fusion_toggle title=”Question 46: What are the key differences between Synchronous programming & Asynchronous programming?” open=”no” class=”” id=””]

Answer:

Following are the key differences between Synchronous & Asynchronous programming:

  • Asynchronous is multi-thread, which means operations or programs can run in parallel. Synchronous is single-thread, so only one operation or program will run at a time.
  • Asynchronous is non-blocking, which means it will send multiple requests to a server. Whereas, Synchronous is blocking — it will only send the server one request at a time and will wait for that request to be answered by the server.
  • Asynchronous increases throughput because multiple operations can run at the same time. Synchronous is slower and more logical.

[/fusion_toggle][fusion_toggle title=”Question 47: What is Garbage Collection in Java?” open=”no” class=”” id=””]

Answer:

The process of removing a heap of unused objects from the memory to make space for JVM is called garbage collection. It is performed for automatic memory management.

[/fusion_toggle][fusion_toggle title=”Question 48: What is Java reflection?” open=”no” class=”” id=””]

Answer:

Java Reflection is a process that analyzes & modifies the capabilities of a class at runtime. Reflection API in Java is used for manipulating class & its members at runtime, including methods, fields, constructors, etc.

[/fusion_toggle][fusion_toggle title=”Question 49: What is the difference between HashSet & TreeSet?” open=”no” class=”” id=””]

Answer:

Following are the major differences between HashSet & TreeSet:

  • HashSet uses HashMap to store its elements internally, while TreeSet used TreeMap.
  • HashSet stores objects in random order; on the contrary, TreeSet stores data in sorted order.
  • HashSet is speedier & faster than TreeSet.

[/fusion_toggle][fusion_toggle title=”Question 50: Name the best Java IDEs in 2023?” open=”no” class=”” id=””]

Answer:

Following are the seven best Java IDEs:

  • Eclipse
  • NetBeans
  • IntelliJ IDEA
  • BlueJ
  • JDeveloper
  • JCreator
  • DrJava

[/fusion_toggle][fusion_toggle title=”Question 51: Define the role of the JDBC DriverManager class?” open=”no” class=”” id=””]

Answer:

The JDBC DriverManager class is an interface between driver & the user. It keeps track of available drivers & handles establishing a connection between the appropriate driver & a database. The DriverManager class helps in maintaining a list of registered Driver classes by calling the method DriverManager.registerDriver() method.

[/fusion_toggle][fusion_toggle title=”Question 52: What are the functions of JVM & JRE?” open=”no” class=”” id=””]

Answer:

Java Virtual Machines (JVM) allows Java programs to run on any operating system or device and manages or optimizes program memory. Whereas, Java Runtime Environment (JRE) is a software layer that runs on top of the operating system software. It provides class libraries & other resources that a Java program needs to run. JRE has three interrelated components for running & developing Java programs.

[/fusion_toggle][fusion_toggle title=”Question 53: Define Serialization in Java?” open=”no” class=”” id=””]

Answer:

Object Serialization is a process of converting a state of an object into a byte stream, which can be persisted into a file or sent over the network to another running JVM.

[/fusion_toggle][fusion_toggle title=”Question 54: What is a singleton class?” open=”no” class=”” id=””]

Answer:

A singleton class is a class with only one instance at a time. After the first time, if we try to instantiate the Singleton class, the new variable also points to the first instance created.

[/fusion_toggle][fusion_toggle title=”Question 55: Define the Ternary Operator?” open=”no” class=”” id=””]

Answer:

The ternary operator or provisional operator is used to making a decision. It is a simplified version of if & else conditional statements used to assign values to variables.

[/fusion_toggle][fusion_toggle title=”Question 56: What is the use of a vector class in Java?” open=”no” class=”” id=””]

Answer:

A vector class is an ArrayList similar to a data structure whose size increases as per the demands. It supports some legacy functions not supported by collections. Unlike collection objects, the vector class is more suitable to work with threads.

[/fusion_toggle][fusion_toggle title=”Question 57: Define implicit objects?” open=”no” class=”” id=””]

Answer:

Implicit objects are a set of objects in Java that the JSP container provides to developers on each page. These objects are accessible as built-in variables through scripting elements & can also be accessed programmatically by Servlets or JavaBeans.

[/fusion_toggle][fusion_toggle title=”Question 58: What is the meaning of lazy loading in hibernate?” open=”no” class=”” id=””]

Answer:

Lazy loading is a type of fetching technique that decides whether to load a child object while loading the parent object or not. It is used for all the entities of Hibernate.

[/fusion_toggle][fusion_toggle title=”Question 59: Define a Unicode?” open=”no” class=”” id=””]

Answer:

In Java, Unicode is a two-byte character code that is used to represent the characters. It defines all the international characters found in different human languages.

[/fusion_toggle][fusion_toggle title=”Question 60: What is Dynamic Initialization?” open=”no” class=”” id=””]

Answer:

Dynamic initialization is a process wherein the initialization value of a variable is unknown when the program is compiled. It means that the initial value of an object is yet to be provided during runtime.

[/fusion_toggle][/fusion_accordion][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Share the Post:

Related Posts

Contact Us