Sunday, January 17, 2021

Top 51 Bootstrap Interview Questions And Answers

 Q #1) Define Bootstrap.

Answer: Bootstrap is a front-end framework that is used for creating HTML, CSS, and JS web applications. Its layout is very responsive, fast and easy to use. It mostly focuses on building a mobile application with having design templates for creating UI like Dropdown, Forms, Buttons, Alerts Tab, etc.

Q #2) Why Bootstrap is used for Mobile Web development?

Answer: It is used for Mobile Web development because it has responsive designs and templates which are easy to use.

Q #3) Explain the features of Bootstrap.

Answer: Its features include:

  • Open source for use
  • Compatibility with all browsers.
  • Responsive designs
  • Easy to use and fast.

Q #4) Define the key components of Bootstrap.

Answer: Its components include:

  • Scaffolding: It has the grid system, background, styles.
  • JS Plugins: Contains JS and jQuery plugins.
  • Customize: Can customize frameworks.
  • CSS: Contains CSS files.

Q #5) What do you understand by Bootstrap container?

Answer: Bootstrap container behaves like a container where you can put HTML code and it is a part within the page where the content of the site can be placed to make it responsive and fast.

Q #6) What do you mean by Bootstrap Classloader?

Answer: Bootstrap class loader is a part of java and a main parental class of class loader.

Q #7) How many types of layouts are there in Bootstrap?

Answer: There are two types of layouts in Bootstrap.

They are:

  • Fluid Layout
  • Fixed Layout

Q #8) Define Fluid Layout.

Answer: Fluid Layout is useful when you need to make an app that involves the full width of the screen i.e. Fluid Layout adjusts itself according to the browser size.

Q #9) Define Fixed Layout.

Answer: A fixed layout is responsive and easy to use but just like the fluid layout, it cannot adjust itself according to the browser size. The fixed layout should be 940 px in most cases.

Q #10) How can you display code in Bootstrap?

Answer: You can display the code in two ways i.e. by using the <code>tag and by using the <pre>tag.

Q #11) When will you use <code>tag and <pre>tag?

Answer: <code>tag is used to show the code inline and <pre>tag is used to show code with multiple lines.

#12) What is a progress bar in bootstrap?

Answer: Progress bar is used with HTML tag style in HTML element using <progress> keyword. In bootstrap, we use html5 <progress> with CSS classes that have special features in bootstrap, which is only made for the progress bar.

#13) Name the contextual classes that are used with the progressive bar in bootstrap.

Answer: The contextual classes used with progressive bar are as follows.

  • Progress-success
  • Progress-info
  • Progress-warning
  • Progress-danger

#14) What are responsive utility classes in Bootstrap?

Answer: Responsive utility classes in bootstrap are a set of classes that are used to conceal or exhibit the HTML elements based on screen resolution that discerns by media query in bootstrap.

Example: “hidden-md-down”, It hides

Q #15) What are the different button styles in Bootstrap?

Answer: In bootstrap, there are seven styles which we can use with the bootstrap button.

  • .btn-default.
  • .btn-primary
  • .btn-success
  • .btn-info
  • .btn-warning.
  • .btn-danger.
  • .btn-link.

#16) What are Bootstrap alerts?

Answer: This is used to create presume alert messages, which adds style to the messages to look more noticeable to the user.

There are four classes in alerts: .alert-success, .alert-info, .alert-warning, .alert-danger.

#17) Define Bootstrap thumbnails.

Answer: It is a way to use the layout images, videos, text, etc. in a grid system. We can create thumbnails by adding a tag with the class .thumbnails around the image.

This will add four pixels of padding and a grey border.

#18) Explain Modal plugin in Bootstrap.

Answer: A model is an inherited window that is layered over its parent window. This is used to augment the user experience and adds different functionalities to the users. Model windows are created with the help of the modal plugin.

#19) Which class is used for pagination in Bootstrap?

Answer: To add pagination on the webpage we have to use the class .pagination.

#20) Explain what is Bootstrap collapsing elements.

Answer: It allows you to collapse any particular element without using any JavaScript code.

To use this feature in bootstrap you have to add data-toggle=” collapse” to the controller element along with a data target to automatically assign the control of a collapsible element. We can use this by writing .collapse(options) etc.

#21) What is Bootstrap Well?

Answer: Bootstrap well is a form of container which thrives or makes the content look recessed on the web page. It also wraps the content by using .well class.

#22) Explain the uses of the carousel plugin in Bootstrap.

Answer: Carousel plugin in bootstrap is used to make sliders in the web pages or your site. There are several carousel plugins that are used in bootstrap to display large contents within a small space by adding sliders.

Example: .carousel(options), .carousel(‘pause’), .carousel(cycle’), .carousel(‘prev’), .carousel(‘next’).

Q #23) What will be the output of the below code and why?

 <div class="progress">
<div class="progress-bar progress-bar-success" style="width: 65%">
<span class="sr-only">75% successfully completed</span>
</div>
<div class="progress-bar progress-bar-warning" style="width: 20%">
<span class="sr-only">30% completed with warnings</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: 15%">
<span class="sr-only">15% did not complete</span>
</div>
</div>

Answer: If we place multiple bars with the same .progress parent element, Bootstrap will pile them into one single progress bar. As we know, in bootstrap the sum of the progress bar is 100 %. So, the progress bar will give the result as full width and fully populated.

#24) How can we customize links of pagination in Bootstrap?

Answer: We can customize the links by using .disabled for unclickable links and .active for indicating the current page.

Q #25) Explain the input group in Bootstrap.

Answer: Input group in bootstrap is put out from controls. By using an input group, we can easily add prepended and appended text or button to the text-based inputs.

We can prepend and append elements to a .form-control by taking all the elements in a <div> under a class .input-group. After that, place your extra content inside a <span> in same <div> by using class .input-group-addon after this you can place the <span> element either before or after the input element.

#26) Write the ways to create a tabbed navigation menu in Bootstrap.

Answer: We can create tabbed navigation by making a basic unordered list with the base class of .nav and after this, we can add class .nav-tabs.

Q #27) In Bootstrap, how can you create a pills navigation menu?

Answer: Pills navigation menu in bootstrap is created by making an unordered list at first with the base class of .nav and after this add the class .nav-pills.

#28) How navbar works in Bootstrap?

Answer: In bootstrap, the navbar is an eminent feature to make a responsive meta component that works as navigation headers for your application and site. In the mobile view, the navbar collapses and becomes horizontal as the available viewport width increases.

#29) How we can create a navbar in Bootstrap?

Answer: To create a navbar in a bootstrap at first, we have to add the classes .navbar.navbar-default to the <nav> tag. After this, we have to add the role=” navigation” to the above element, and this will help inaccessibility.

We have added a header class .nav-header to the <div> element, which will include an <a> element with a class navbar brand. From this, we will get a text with a larger size.

#30) What is Bootstrap breadcrumb?

Answer: Bootstrap breadcrumb is an efficient way to show hierarchy-based information for a site. This can show the dates of publishing, categories or tags in a blog. They also tell the user about the current page location within a navigational hierarchy.

So we can say that Bootstrap breadcrumb is simply an unordered list with a class of .breadcrumb.

Q #31) What are labels in Bootstrap?

Answer: Bootstrap labels are used for offering counts, tips or other things to provide markup on web pages. To use the label in Bootstrap we use the class .labels to indicate the labels.

Q #32) What are badges in Bootstrap?

Answer: Badges are homogeneous to labels, the main difference between them is corners are more rounded. The main work of badges in the bootstrap is to highlight new or unread items. To use badges just add <span class=”badge”> to links and bootstrap navs.

#33) What is a jumbotron in Bootstrap?

Answer: It is used to increase the size of headings and to add a lot of margins for landing page content. To create a jumbotron we have to create a container <div> with the class of .jumbotron.

#34) How can we make image responsive in Bootstrap?

Answer: After the updates in Bootstrap, currently the feature to make an image responsive has been added, we can do this by adding a class .img-responsive to the <img> tag. This class makes the width max-width =100%; and height=auto; to the image so that it matches nicely to the parent element.

#35) What do you mean by normalize in Bootstrap?

Answer: Bootstrap normalize is a small CSS file that is used to make cross-browser consistency.

Q #36) What is lead body copy in Bootstrap?

Answer: It is used to add some ascent to the paragraph if we add class=”lead”. This will enlarge the font size and taller line-height.

#37) What are panels in Bootstrap?

Answer: Panels are components that are used when you want to put your DOM component in a box. So, to retrieve a basic panel we just need to add class.panel to the <div> element. We can also add class.panel-default to this element.

#38) How will you create a Bootstrap panel with the heading?

Answer: There are two ways by which we can add panel heading.

First is, we can directly use the .panel-heading class to add heading containers in a panel and the second way is by using any heading tag like <h1> to <h6> with a .panel-title class to give more styles on the heading.

#39) What is a scrollspy plugin in Bootstrap?

Answer: It is an auto-updating nav plugin that allows in fetching section of the page based on the scroll position. This can be done by the .active class to the navbar based scroll position.

#40) What is the work of the affix plugin in Bootstrap?

Answer: This plugin allows a <div> to be attached to a location on the page.

Use of the social icon in a page is an example for this in which we see that the icons will start in a location, but when the page hits on a certain mark it will block the <div> in place and will stop the scrolling for rest of the page.

#41) What is the grid system in Bootstrap?

Answer: By using the grid system, we can make up to 12 columns across a page. There are different classes that have been defined for this for the UI purpose.

#42) What are Grid classes in the Bootstrap?

Answer: There are four grid classes in Bootstrap.

They are:

  • xs (It is used for phone screens less than 786px wide).
  • sm (It is used for the tablet screens which are greater than 786px wide).
  • md (It is for small laptop screen of size equal to or greater than 992px wide).
  • LG ( It is for laptop and desktop screens which are equal to greater than 1200px wide).

#43) What are global styles that are used in Bootstrap Default Typography?

Answer: In Bootstrap the global default font-size is 14px and the line height is 1.428. The default font changes to Helvetica and Arial are with sans-serif fallback and all these styles are applicable for both body and all paragraphs.

#44) What will be the output of the below code?

<div
class="row">
<div class="col-xs-12 col-md-3">.col-xs-12 .col-md-3</div>
</div>

Answer: The output of this will give the grids for extra small devices as we can see in the snippet col-xs-12 that has been used and it will also give the grids for desktop devices and above as the class col-md-3 has been used.

#45) What dependencies does Bootstrap require to work properly?

Answer: jQuery is the only dependency that bootstrap requires for working properly and this is only for JavaScript plugins in bootstrap.

#46) Explain what the below code will do?

<a href="#">Home <span class="badge">36</span></a>

Answer: This code will produce a link with an inline badge which will give an important notification to the user like number received, message received or the number of requests, etc.

#47) What are the two codes that are used for code display in Bootstrap?

Answer: The codes are <code> tag and <pre> tag.

#48) What is the difference between Bootstrap and Foundation?

Answer: Bootstrap uses very fewer preprocessors as it supports less and it allows the designing and development for both mobile and desktop. On the other hand, Foundation supports sass processors and it is used only for mobile UI designing.

#49) What are Glyphicons in Bootstrap?

Answer: By this, we can use the icon simply anywhere in your code.

<span class=”glyphicon glyphicon-search”></span>

#50) What is a transition plugin in Bootstrap?

Answer: It provides simple transition effects like sliding or fading in modals.

#51) Explain the concept of creating a vertical or basic form in Bootstrap.

Answer: For this first we have to add a role form to the parent <form> element then we have to wrap labels and controls in a <div> with class.form-group and then we have to add a class of .form-control to all text url <input>,<textarea> and <select> elements.

Eclipse For C++: How To Install, Setup And Use Eclipse For C++

 

Eclipse For C++

The development environment for Eclipse includes:

  • Eclipse Java Development Tools (JDT) for Java and Scala.
  • Eclipse C/C++ Development Tools (CDT) for C/C++.
  • Eclipse PHP Development Tools (PDT) for PHP.

Official Website: Eclipse

In this tutorial, we will explore the features of the Eclipse IDE with respect to C/C++ development (Eclipse CDT) and also discuss all the steps to setup eclipse on our computer to begin development.

Features Of Eclipse IDE

Enlisted below are the features of Eclipse IDE:

  • Almost everything in Eclipse is a plugin.
  • We can extend the functionality of Eclipse IDE by adding plugins to the IDE, maybe for additional programming language or version control system or UML.
  • Eclipse has a wonderful user interface with drag and drop facility for UI designing.
  • Supports project development and administered framework for different toolchains, classic make framework, and source navigation.
  • Supports various source knowledge tools like folding and hyperlink navigation, grading, macro definition browser, code editing with syntax highlighting.
  • Provides excellent visual code debugging tool to debug the code.

Install And Configure Eclipse For C++

In order to install and configure Eclipse IDE for C/C++ development, firstly, we need to make sure that we have an appropriate GCC compiler on our machine.

Please follow the following steps to install and configure Eclipse IDE for C/C++.

Step 1: Install GCC Compiler

Eclipse CDT uses C/C++ Compiler. Hence before we can start using Eclipse CDT for C/C++ development, we need to have a proper GCC compiler on our system. We can either have ‘MinGW’ or ‘Cygwin’ compiler on our machine that will be used by eclipse.

We will not go into the details of the installation of these compilers, but we will provide the appropriate links that will be useful to our readers.

=> Click here to install MinGW Compiler

=> Click here to install Cygwin Compiler

Step 2: Install Eclipse C/C++ Development Tool (CDT)

There are two ways of installing Eclipse CDT based on whether you already have an Eclipse IDE on your system or not, depending on whether you have previously installed an Eclipse:

If you already have Eclipse JDT (Eclipse for Java) or any other Eclipse environment on your system, then you can add a CDT plug-in to this environment.

Given below are the steps to add CDT plug-in to the existing Eclipse environment:

#1) Launch Eclipse.exe

When you launch Eclipse for the first time you have to create a workspace that will hold all your projects. After that every time you open Eclipse IDE, you will be shown a dialog to select the workspace.

launch Eclipse

In the above dialog, you can either create a new workspace or select an existing workspace, click ok and the IDE will open.

#2) Click Help =>Install New Software. In the “Available Software” dialog, enter “Kepler – http://download.eclipse.org/releases/kepler” (or Juno for Eclipse 4.2; or Helios for Eclipse 3.7) in the “Work With” field or pull down the dropdown menu and select the above link.

#3) In the “Name” field, expand “Programming Language” and check the option “C/C++ Development Tools”.

#4) Click Next => Finish.

This sequence of steps is shown in the below screenshot:

Install plugin - sequence of steps

Once the plug-in is installed, we are ready to begin C/C++ development using Eclipse IDE.

If there is no Eclipse IDE present on the system, then we can directly install Eclipse CDT by downloading the Eclipse CDT package.

There is no installation sequence as such, you just have to unzip the contents of the downloaded package and then run “Eclipse.exe” and you are ready for C/C++ development using the Eclipse IDE.

Step 3: Configuring Eclipse IDE

It is not required to specifically do any configuration for Eclipse CDT as long as you have MinGW or Cygwin binaries updated in the PATH environment variable.

CDT searches the PATH and discovers the C/C++ Compilers on its own.

Now you are ready to use the Eclipse.

C++ Development Using Eclipse IDE

To test the environment you just configured, open Eclipse.exe.

Choose File => New => C++ Project and the below screen will appear.

Development using Eclipse IDE

Here you can specify the name of the project. You can select an Empty project or a sample “Hello World” application project. The compilers present on your system are listed under “ToolChains”. You can select the appropriate compiler and then click Next.

Another way to select the compiler and set other properties for the just created project is to right-click on the project name in the project explorer and select “Properties”.

You will be presented with the following screen.

Environment variables to set

In this dialog, we can set various properties for the selected project.

Once the project is ready, we can add a file with the .cpp extension and write a code. Once you have written the desired code, it’s time to compile and build the code.

Note that you can have more than one code file in the project. You can also create a C++ class inside the project.

Build And Execute Projects In Eclipse

We can build the project by right-clicking the project name in the Project Explorer and select “Build Project”.

Once the build is successful, run or execute the project. For this, right-click the project name on the Project Explorer and click “Run as”. Then select “Local C/C++ Application”. This runs your application.

Debugging An Application In Eclipse

If you get the desired output when you run the project, then you can say that the project is successful. But if you don’t get the desired results, then you might have to debug your application.

Let’s see how to debug an application in Eclipse.

To debug a project, we have to perform the following steps:

#1) Set a Breakpoint

By setting up a breakpoint, you can suspend the execution of the program. This will allow you to examine the program step by step and also watch the intermediate values of variables and flow of execution so that you can find out the problem in your code.

It is normally a good practice to set the breakpoint in the main function as it’s the starting point for a C++ program. To set a breakpoint, you can double click on the left panel of the code file against the line of code for which you want a breakpoint.

Another way is to click “Ctrl+Shift+B” by placing the cursor on the line of code for which the breakpoint is needed.

Set a breakpoint

The red arrow shows the line for which the breakpoint is set. It is denoted by a circle on the left-hand pane.

#2) Start Eclipse Debugger

Once the breakpoint is set, you can start debugger by right-clicking (or Run option in the menu) the project name and select “Debug As=> Local C/C++ Application”. On doing this your execution will pause at the line at which the breakpoint is set.

#3) Step Over and Watch Variables and Output

After starting the debug, you can “Step Over” each line of code and examine the variable values by hovering your mouse over that variable.

This process of stepping through each line of code is the ultimate method to debug your program.

#4) Debug operations => Run-to-line resume, terminate

These are all the operations that you can perform with debugging. Run-to-line will continue the program execution up to the line where the cursor is placed.

Resume continues the program execution up to the next breakpoint or till the end of the program. Terminate -terminates the debugging session.

The below screenshot shows the debug toolbar and the operations that we discussed.

debug toolbar

#5) Switch back to the development perspective.

development perspective

Click the C/C++ icon shown in the above screenshot to switch back to the project for further programming.

Readers can explore the other debugger features like step-into (wherein we can go inside any function and debug it), modify the value of the variable being watched, etc.

Top 30 Eclipse Interview Questions And Answers

 Q #1) What is an Eclipse IDE?

Answer: Eclipse IDE is the most widely used Java development environment. It is also used to develop applications in other programming languages like Python, C#, C++, etc.

Q #2) What are the system requirements for Eclipse IDE to run successfully on our computer system?

Answer:  A system must have the latest version of the Java run time properly installed, for Eclipse IDE to run successfully in it. You can install either ‘JRE’ or ‘JDK’ depending on the task you need to perform with Eclipse IDE.

To check if our system has a Java runtime environment installed in it or not-

Use command prompt and type in the command ”Java -version’. Please refer the below figure:

Checking Java Version

(Please note that: I have installed Java JDK file on my system).

Q #3) What is the latest version of Eclipse IDE that is released?

Answer: Eclipse oxygen 64-bit is the latest version of Eclipse IDE. It was released on 28 June 2017.

Q #4) Name different versions of Eclipse IDE?

Answer:

Eclipse Version NameVersion Number
Oxygen4.7
Neon4.6
Mars4.5
Luna4.4
Kepler4.3
Juno3.8 and 4.2
Indigo3.7
Helios3.6

Q #5) What are the types of files likely to be found in the ‘src’ and ‘bin’ folder, of your java project developed using Eclipse IDE?

Answer: If you have developed a Java project using Eclipse IDE and added codes to meet the project requirements, then you can find ‘.java’ files in the ‘src’ folder and corresponding ‘.class’ files in the ‘bin’ folder. (When we run a Java Project; ‘.java’ files are compiled to ‘.class’ files).

Q #6) What are the Operating Systems that support Eclipse IDE?

Answer: Eclipse IDE is a cross-platform, hence it can be successfully installed and used as a development environment in almost all the operating systems like Windows, Mac, Linux, Solaris, etc.

Q #7) How to create the documentation of a project using Eclipse IDE?

Answer: If we need to generate documentation for a project using Eclipse IDE, select ‘Project’ in a menu item and then select ‘Generate Javadoc’.

Then, we need to add a library (javac.jar) file to the project and specify a location in the system to save the document generated.

Generate documentation for project:

public class FirstClass{
/* Here is the statements in documentation*/
int user_name;
int user_emailID;
public int getUser_name(){
return user_name;
}
public void setUser_name(int user_name){
this.user_name=user_name;
}
public  int getUser_emailID(){
return user_emailID(){
}
public void setUser_emailID(int user_emailID){
this.user_emailID=user_emailID;
}
}

Generate JavaDoc

After generating the documentation of the project, you will get a new folder in the project explorer named as ‘doc’. Open ‘index.HTML’ within the ‘doc’ folder and there we can find the project documentation. Please refer the below figure:

Final Documentation Project

Q #8) Why is it always better to ‘Close’ a Project in Eclipse IDE than leave it ‘Open’ in the Package Explorer?

Answer: In an Eclipse IDE, we can have a number of projects in the ‘Package Explorer’. Those projects can be either in ‘Open’ or ‘Closed’ state.

An ‘Open’ project will consume a lot of memory. Also ‘Open’ projects take up build time especially when we try to ‘Clean’ the projects in the workspace. So, it is always better to ‘Close’ a project.

Q #9) If you need to ‘Reset’ a particular perspective in Eclipse IDE, how will you attain it?

Answer: The common name given to the default arrangement of views and editor area in the development environment is called a ‘perspective’ in Eclipse IDE.

 To ‘Reset’ a particular perspective in Eclipse IDE:

  • Select the ‘perspective’ icon as displayed in the image below. It is usually shown on the top right corner of Eclipse IDE.
  • Right-click on the icon.
  • Select the ‘Reset’, thus we can reset the views in perspective.

Reset Button

‘Reset’ action will put all the windows back in a position where they are supposed to be, by default.

Q #10) Explain how to add a jar file to the project build path in Eclipse IDE?

AnswerFor adding a utility ‘jar’ file to the project created in Eclipse IDE, refer below steps:

  • Select the ‘project’.
  • Right-click the project.
  • Select ‘properties’.
  • Select ‘Java build path’.
  • Select the ‘libraries’ tab.
  • Select ‘add external jar file’.
  • Find the location of the ‘jar’ file in your system and add the same to the project.

After this, we can use the functionalities and features related to the jar file in the project.

Java Build Path

Q #11) What are the tasks that you can accomplish with Eclipse IDE?

Answer: The tasks that can be accomplished are stated below:

  • We can create a generic project using Eclipse IDE. A generic project is a set of guidelines, tricks, rules, tasks, and tips that help you to create the product and market your product, in a faster and efficient way.
  • Edit files in the generic text editor.
  • Share files using CVS (Concurrent Version System) server.

Q #12) What is the Eclipse IDE Modelling framework?

Answer: While creating a project using some IDE we may add ‘class’ files, create a model for the project and create an XML schema for the same. If we have a better modeling framework, we need to create only one of these entities and the rest of them will get created along. This is done by EMF (Eclipse Modelling Framework).

So, EMF is a set of Eclipse plug-ins, which can be used to model a data model and to generate code from it. This framework is a Java /XML framework.

Q #13) How to generate code automatically with the Eclipse IDE?

Answer: Consider an example where you have a class file and some attributes inside the class.

You need to generate ‘get’ methods and ‘set’ methods for the value of an attribute in the class. We can use the ‘Generate Getters and Setters’ feature of Eclipse. Eclipse IDE can automatically generate getters and setters methods for the attributes as shown in below image:

.Generate Code Automatically

Q #14) Explain about ‘Builders’ associated with the projects in Eclipse IDE?

Answer: Projects created in Eclipse IDE have zero or more ‘builders’ associated with it. A builder is responsible for compiling the source code and generating classes for the associated project.  A Java project is associated with a java builder.

To find the builders associated with a project:

  • Select the ‘Project’.
  • Right-click on the ‘Project’ in the Package Explorer.
  • Select ‘Properties’.
  • A window named ‘Properties for sample’ is shown, in the left-hand side tree check for ‘Builders’. Select it.

Builders

Q #15) What is the Rich Client Platform?

Answer: A minimal set of plugins that you need to build a rich client application is known as the Rich Client Platform.

Creating a sample application Eclipse IDE needs only two plugins like ‘org.eclipse.ui’ and ‘org.eclipse.core.runtime’.

Q #16) What is Workspace?

Answer: Workspace is the actual location of a project developed using Eclipse IDE. It contains source files, images and other artifacts like preference settings, plug-in, specific metadata, logs, etc.

To change the workspace location:

  1. Click ‘File’ in the menu bar.
  2. Select the ‘Switch Workspace’.
  3. Select a new location to create/open a new project.

Switch Workspace

Q #17) How to install a new plug-in and run it at the start of Eclipse IDE?

Answer: We can install third-party plug-ins in Eclipse IDE using ‘Help’ –> ‘Install Software’.

Install New Plug-in

Usually, a plug-in has two parts, a declarative part, and a code part. The declarative part is in a plugin.XML and is loaded when the platform starts running and is available regardless of whether a plug-in has started.

When the user starts coding, the plugins functionality is explicitly invoked by the user.

Q #18) How is Refactoring done in Eclipse IDE?

Answer: Re-factoring is the method of reconstructing the code without behavior changes. One of the examples of refactoring is ‘rename’ a class or a method. If you need to change the name of a class or method, you can right-click on your class and select ‘rename’ and then we can type in the desired name.

Eclipse IDE will make sure that the name is changed everywhere without any further effort.

Q #19) Where can we find the log file in Eclipse IDE?

Answer: When a problem is encountered, we will have the reports of them documented in the workspace log file. The location where the log file stored is in the workspace/.metadata/.log. In Eclipse IDE error log view will show all the captured errors.

In Eclipse IDE, error log is available under Windows -> Show view -> Error log.

Log File

Q #20) While a User is running the Eclipse IDE, the following error occurred? Error: “Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run eclipse”.

JRE error pop up

How to solve the issue?

Answer: If the issue is raised, we must verify whether we have added the Java location in ‘environment variables’ for the system properties correctly.

In order to verify if ‘environment variables’ has been added to System Property correctly, follow the below steps:

  • Select ‘My computer’.
  • Select ‘properties’.
  • Select ‘advance system settings’.
  • Select the ‘advance’ tab.
  • Select ‘environment variable’.
  • Click the ‘new’ button under the user variable and enter a variable name as ‘path’.
  • Copy the location of Java bin and paste it in the starting of the variable value and click ‘ok’.
  • After completing the process, run the Eclipse IDE.

Edit System Variable

Q #21) How to format the codes in Eclipse IDE?

Answer: Control+Shift+F is the shortcut for formatting statements. But if we want to format the entire project, use ‘autoformat’ functionality IDE.

Format the code

  • Select “Windows”.
  • Select “Preferences”.
  • Then type in “format “ as displayed in the above image.
  • Then search for “Java -Code Style –formatter”. Here, we will have a default format style. We can change it by edit option.

Indentation Screen

For Example, ‘braces’.

We can put ‘braces’ on the same line or the next line according to our convenience and the coding standards that are chosen. You can configure all types of formatting here. If you are working on a team project, you can export the preferences of format and share it with the other members of the team.

Q #22) What is Hot Code Replace?

Answer: ‘Hot Code Replace’ is a debugging technique, which means it is possible to alter the codes in Java files (if needed) while debugging the codes on a run-time workbench. For Eclipse IDE, restart is not required to accomplish the task.

The debugger will replace the code in the Virtual Machine while it is running.

Q #23) How can you run an eclipse IDE in a clean mode?

Answer: If you can install a new plugin or remove the unused plugins from Eclipse IDE, then it is recommended to run the development environment in a clean mode. The process will clear all the cached information and will not affect any workspace related data.

To run an eclipse IDE in clean mode there are two methods:

a) Start the IDE using the command line in cmd prompt ‘eclipse -clean’

Run IDE in clean mode

OR

b) Edit the eclipse.ini file by inserting the line ‘-clean’ as the first line in the file. Make sure to remove the same line from ini file, as it causes Eclipse to re-evaluate all of the plugins every time it starts up and increases the startup time.

Q #24) If Eclipse IDE throws an error, ‘Missing R.java file’, how can we solve the issue?

Answer: The R.java file is an auto-generated file that contains references to all the resources used in a project.

Possible fixes for the error is:

  • Make sure that in ‘Eclipse IDE ‘–in menu item ‘Project’ -> “Build automatically” is checked.
  • Then ‘Clean’ your project and ‘Build’ it again.
  • Make sure that there are no errors in your XML files.

 Q #25) Explain the Debug Configuration in Eclipse IDE?

Answer: Users can change the ‘Debug Configuration’ for a Java project created using Eclipse IDE.

To change the ‘Debug Configuration’:

  • Select the ‘Run’ menu item.
  • Select “Debug Configurations”.
  • Select the “Java Application” from the list on the left-hand side (if we need to create debug configuration for Java application) and click on the New button. A dialog box comes up.

Debug Configuration

Q #26) Describe few frequently used shortcuts that are used in Eclipse IDE.

Answer:

a) Press Ctrl + Shift + L, it will open a widget that shows all the shortcut keys.Shortcuts used in Eclipse IDE

b) In Java editor press Ctrl+ Space to see the list of suggested auto-completion available in Eclipse IDE.

List of Suggested Auto Completions

c) When the cursor is positioned inside the method argument in a class, then press Ctrl + Shift + Space in a keyboard to see a list of the suggested parameters.

List of Suggested Parameter

d) Type ‘/**’ and press Enter key. It will automatically be added to the commands that we can include in the Javadoc document.

Javadoc document

Q #27) What are the views of an Eclipse IDE Workbench?

Answer: The major visible parts of an Eclipse IDE are:

  • Views
  • Editors (all appear in one editor area)
  • Menu Bar
  • Toolbar

Q #28) Name the Menu items that are available on the Menu Bar of an Eclipse IDE.

Answer: Menu items shown on the Menu Bar of IDE depend on the installed plug-ins in the Eclipse IDE. Customization of the Menu items can also be done using the Customize Perspective dialog box to show the desired menu items.

Menu Bar of an Eclipse IDE

  • File menu
  • Edit menu
  • Source menu
  • Refactor menu
  • Diagram menu
  • Navigate menu
  • Search menu
  • Project menu
  • Run menu
  • Window menu
  • Help menu

Q #29) If you encounter the following error while launching the Eclipse IDE, What will you do to fix the Issue?

Error while launching the Eclipse IDE

Errors: “could not create a Java Virtual Machine. A fatal exception has occurred. The program will exit”. Explain?

Answer: Error you have encountered now is an ‘Exit’ error. To fix this issue, we need to add the ‘Virtual Machine Path’ in the ‘eclipse.ini’ file.

Virtual Machine Path

Open eclipse.ini file and make sure that you add the path before vmargs (as shown in the above figure). Save the eclipse.ini file and try to launch Eclipse IDE again.

Q #30) How can we know the details about plug-ins installed in Eclipse IDE?

Answer: Eclipse is considered to be an extensible IDE as we can install several plug-ins in the IDE which in turn makes it so popular for development purposes.

To know the details about the list of plug-ins installed in Eclipse IDE:

  • Select ‘Help’
  • Select ‘About Eclipse’

In the ‘About Eclipse’ Window, we can find all the “Installation Details” of it.

List of plug-ins installed

If we click on the ‘Installation Details’, we can see the details of all the plug-ins installed in IDE.

Eclipse Plugins

Get max value for identity column without a table scan

  You can use   IDENT_CURRENT   to look up the last identity value to be inserted, e.g. IDENT_CURRENT( 'MyTable' ) However, be caut...