[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=””]

Java is a versatile language that is used in mobile apps, Software, and smart devices. After the advancements in fields like Machine learning, robotics, and artificial, Java use cases have increased too. Due to its features, flexibility, and vast support, it is a critical language to succeed in the tech world today.
So, if you looking for a career in tech, make sure you know Java. Our 200 core Java interview questions will help you grasp the basic concepts. Once you have mastered the Java basic concepts, you can step into any career that requires Java.
Our interview questions page will help you get ready for a career in Java as it includes clear explanations. So, let’s start practicing the Java concepts by going through the questions.
[/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 101: Define core java?” open=”no” class=”” id=””]
Answer:
Core Java is not just the programming language, but it is a collection of libraries. It is the purest form of Java used for general desktop application development. Core Java is the subset of Java SE (Standard Edition) technologies that comprises both general & special purpose API’s.
[/fusion_toggle][fusion_toggle title=”Question 102: How to enable Java in Chrome?” open=”no” class=”” id=””]
Answer:
Follow these steps to enable Java into Chrome:
- Click on the Security tab in Java Control Panel;
- Thereon, select the option Enable Java content in the browser;
- Click Apply & OK to confirm the changes;
- Finally, restart the browser to enable the changes.
[/fusion_toggle][fusion_toggle title=”Question 103: Explain the internal working of HashMap in Java?” open=”no” class=”” id=””]
Answer:
HashMap uses it’s inner class Node<K,V> for storing map entries. HashMap stores entries into multiple singly linked lists, called buckets or bins. HashMap uses hashCode() and equals() methods on keys for get and put operations.
[/fusion_toggle][fusion_toggle title=”Question 104: What is a bytecode in Java?” open=”no” class=”” id=””]
Answer:
Once a program written in Java has converted to bytecode, it can be transferred across a network & executed by JVM. Bytecode files generally have a .class extension. It is the compiled format for Java programs.
[/fusion_toggle][fusion_toggle title=”Question 105: How to connect databases in Java?” open=”no” class=”” id=””]
Answer:
Below are the fundamental steps to connect database in Java:
- Import JDBC packages.
- Load & register the JDBC driver.
- Open a connection to the database.
- Create a statement object to perform a query.
- Execute the statement object & return a query ResultSet.
- Process the ResultSet.
- Close the ResultSet & statement objects.
- Close the connection.
[/fusion_toggle][fusion_toggle title=”Question 106: What is enum in Java?” open=”no” class=”” id=””]
Answer:
An enum refers to a special “class” representing a group of constants like unchangeable variables or final variables. To create an enum in Java, you should use an enum keyword instead of an interface or class & separate the constants with a comma.
[/fusion_toggle][fusion_toggle title=”Question 107: What is DAO in Java?” open=”no” class=”” id=””]
Answer:
DAO or Data Access Object is a structural pattern that enables us to isolate the business or application layer from the persistence layer using an abstract API (Application Programming Interface).
[/fusion_toggle][fusion_toggle title=”Question 108: What is AWT in Java?” open=”no” class=”” id=””]
Answer:
AWT or Abstract Window Toolkit is Java’s original platform-dependent graphics, windowing, & user-interface widget toolkit. AWT is a part of JFC (Java Foundation Classes), the standard API for providing a GUI for a Java program. It is also a GUI toolkit for several Java ME profiles.
[/fusion_toggle][fusion_toggle title=”Question 109: What is a framework in Java?” open=”no” class=”” id=””]
Answer:
Framework in Java is a collection of predefined functions & classes used to process input, manage hardware devices interacts with system software. It helps developers to build an application by writing their own code.
[/fusion_toggle][fusion_toggle title=”Question 110: How to update Java on Windows?” open=”no” class=”” id=””]
Answer:
Follow these steps to update Java:
- Go to the Windows Start Button & select Settings, then Control Panel.
- Click Java (an icon of a coffee cup with steam) in the Control Panel list.
- Select the Update tab, then click on the Update Now button & make the changes.
[/fusion_toggle][fusion_toggle title=”Question 111: What is a variable in Java?” open=”no” class=”” id=””]
Answer:
A variable is a part of memory that contains a data value. Java variables are typically used to store information, which your Java program needs to perform its job.
[/fusion_toggle][fusion_toggle title=”Question 112: Define functional interface in Java?” open=”no” class=”” id=””]
Answer:
A functional interface in Java refers to an interface with only one abstract method, meaning that the interface implementation will only represent one behavior.
[/fusion_toggle][fusion_toggle title=”Question 113: What was Java initially named?” open=”no” class=”” id=””]
Answer:
At first, Java was called Oak, named after an oak tree that stood external to Gosling’s office. Later, the task passed by the name Green and finally, it was renamed Java, inspired by an Indonesian coffee brand, Java.
[/fusion_toggle][fusion_toggle title=”Question 114: What are static variables, static methods, & static blocks?” open=”no” class=”” id=””]
Answer:
Static methods can be called directly inside a class without using an object. Static variables are shared amongst all instances of a class. Static blocks are code blocks that are loaded like a class is loaded in the memory.
[/fusion_toggle][fusion_toggle title=”Question 115: What is the use of a static method in Java?” open=”no” class=”” id=””]
Answer:
In Java, a static method is a method that belongs to a class rather than an instance of a class. The method is accessible to every instance of a class, but methods defined in an instance are only able to be accessed by that object of a class.
[/fusion_toggle][fusion_toggle title=”Question 116: What are the interfaces?” open=”no” class=”” id=””]
Answer:
An interface is a collection of static methods, constants, default methods, and abstract methods.
[/fusion_toggle][fusion_toggle title=”Question 117: How is abstraction achieved in Java?” open=”no” class=”” id=””]
Answer:
Abstraction is achieved by using two ways in Java, i.e., abstract class & abstract methods.
[/fusion_toggle][fusion_toggle title=”Question 118: Why are strings immutable in Java?” open=”no” class=”” id=””]
Answer:
Strings in Java are usually used for HashMap keys. So, if a person changes a string’s value, it will cause severe discrepancies. Therefore, strings are made immutable.
[/fusion_toggle][fusion_toggle title=”Question 119: Can interfaces be inherited in Java?” open=”no” class=”” id=””]
Answer:
Yes, Java interfaces can be inherited. Java supports Hierarchical & Hybrid inheritances through inheritable interfaces.
[/fusion_toggle][fusion_toggle title=”Question 120: Can a Java interface have static methods?” open=”no” class=”” id=””]
Answer:
Yes, Java interfaces can have static methods since static methods are treated as default methods, so they don’t need to be implemented.
[/fusion_toggle][/fusion_accordion][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

