HTML, GWT, Java Interview Questions & Answers

5 avg. rating (100% score) - 1 votes

HTML, GWT, Java Interview Questions & Answers

Becoming a pro at Java Scripting is commendable. Do you want excel at your career by handling web-toolkit? Wisdom jobs is the right place to find right opportunities for your continuous escalating career. GWT or Google Web Toolkit is a development toolkit that helps web developers to build and optimize complex java front-end applications by using Javascript. GWT is an HTML widget that enables productive development in web applications. HTML GWT Java jobs require basic knowledge of web services, Java frameworks, java scripting and database design etc. Various roles for HTML GWT Java jobs such as GWT developer, java developer, senior developer, and team lead are offered by many reputed MNC organizations in India. Access HTML GWT Java job interview questions and answers page constructed by wisdomjobs.com professionals to faceoff any challenge that comes your way. Subscribe to receive daily notifications on latest jobs.

HTML, GWT, Java Interview Questions

HTML, GWT, Java Interview Questions
    1. Question 1. What Is Html?

      Answer :

      HTML is short for HyperText Markup Language, and is the language of the World Wide Web. It is the standard text formatting language used for creating and displaying pages on the Web. HTML documents are made up of two things: the content and the tags that formats it for proper display on pages.

    2. Question 2. What Are Tags?

      Answer :

      Content is placed in between HTML tags in order to properly format it. It makes use of the less than symbol (<) and the greater than symbol (>). A slash symbol is also used as a closing tag. For example:
      sample

    3. Question 3. Do All Html Tags Come In Pair?

      Answer :

      No, there are single HTML tags that does not need a closing tag. Examples are the  tag and tags.

    4. Question 4. How Do You Insert A Comment In Html?

      Answer :

      Comments in html begins with “
      <!–“-- “–>”.
      For example:
      <!-- compuhelp -->

    5. Question 5. Do All Character Entities Display Properly On All Systems?

      Answer :

      No, there are some character entities that cannot be displayed when the operating system that the browser is running on does not support the characters. When that happens, these characters are displayed as boxes.

    6. Question 6. What Is The Purpose Of Canvas In Html?

      Answer :

      Canvas is an element that is used for the graphics for the web page. It uses JavaScript to bring the graphics functionality live. It allows easy way to draw the graphics and use different types of tools to create drawing on the web page. Canvas is just a rectangular area that controls the pixel of every element that is used in the web page. Canvas uses methods like paths, circles, etc.
      The canvas element will be used as follows:
      <canvas id="can" width="200" height="100"></canvas>
      The canvas element includes id, width and height settings and with the javascript it gets used like:
      <script type="text/javascript">
      var c=document.getElementById("can");
      var ctx=c.getContext("2d");
      ctx.fillStyle="#FF0000";
      ctx.fillRect(0,0,150,75);
      </script>

    7. Question 7. What Is The Purpose Of Iframe In Html?

      Answer :

      Iframe is called as inline frame that places one HTML document in a frame. It is different from the object element as the inline frame can be made in the target frame. The target frame consists of the links that is defined by other elements used in the web page. Iframe is used to focus on printing or viewing of the source. Iframe can be used by the user in those browser that supports it. If they have used iframe also then the incompatible browser won't display the actual but display of the alternative text will take place.
      Syntax: <iframe>-----</iframe>

    8. Question 8. What Is The Main Function Of "pre" Tag In Html?

      Answer :

      "pre" tag defines the pre-formatted text that is used to display the text with the fixed width and uses a predefined fonts and it keeps both spaces and line breaks separate and show the text as it is.
      The code that can be used to display the text that can be written in whatever way the user wants is as follows:
      <pre>
      Text in a pre element ----//
      is displayed in a fixed-width
      font, and it preserves
      both spaces and
      line breaks
      </pre>

    9. Question 9. How Can Tables Be Made Nested In Html?

      Answer :

      Tables can be made nested by making it come in another table. This consists of many attributes and tags that can be used in nesting the tables.
      <table>
          <tr>
            <td>this is the first cell</td>
            <td>this is the second cell</td>
      <table> 
      <tr>
      <td>this is the first cell second table</td>
      <td>this is the second cell of second table</td>
      </tr>
      <table>
      </td>
      </tr>
      </table>

    10. Question 10. How To Prevent The Display Of “getting Framed In Html?

      Answer :

      Getting framed refers to the document that is being displayed in someone else's frameset in your HTML. This will be password protected and the permissions has to be taken before inserting the frameset. The framing of the document can be avoided by using TARGET=_top applied to all the links that will lead to the document that are outside the scope of a particular user without permission. A javaScript can be used that will automatically handle the request to remove the existing framesets. This can be given as:
      <script type="text/javascript">
      if (top.frames.length!=0) 
      {
          if (window.location.href.replace)
             top.location.replace(self.location.href);
          else
             top.location.href=self.document.href;
      }
      </script>

    11. Question 11. How To Include A Frame Set Inside Another Frame Set?

      Answer :

      One frameset can be defined inside another frameset if the accessing permission are provided directly. The frameset can be stored by using the JavaScript in the document that is being written by the user and the script is as follows:
      <script TYPE="text/javascript">
      if (parent.location.href == self.location.href) 
      {
          if (window.location.href.replace)
             window.location.replace('frame.html');
          else
             // causes problems with back button, but works
             window.location.href = 'frame.html';
      }
      </script>

    12. Question 12. What Is Semantic Html?

      Answer :

      Semantic HTML is a coding style. It is the use of HTML markup to reinforce the semantics or meaning of the content. For example: In semantic HTML
       <b> </b>
      tag is not used for bold statement as well as
      <i> </i> 
      tag is used for italic. Instead of these we use
      <strong></strong>
      and
      <em></em> 
      tags.

    13. Question 13. What Is A Marquee?

      Answer :

      A marquee allows you to put a scrolling text in a web page. To do this, place whatever text you want to appear scrolling within the <marquee> and </marquee> tags.

    14. Question 14. What Are Empty Elements?

      Answer :

      HTML elements with no content are called empty elements. For example:<br> , <hr> etc.

    15. Question 15. What Are The Different New Form Element Types In Html 5?

      Answer :

      Following is a list of 10 important new elements in HTML 5:

      1. Color
      2. Date
      3. Datetime-local
      4. Email
      5. Time
      6. Url
      7. Range
      8. Telephone
      9. Number
      10. Search

    16. Question 16. Is There Any Need To Change The Web Browsers To Support Html5?

      Answer :

      No. Almost all browsers (updated versions) support HTML 5. For example: Chrome, Firefox, Opera, Safari, IE etc.

    17. Question 17. Which Video Formats Are Supported By Html5?

      Answer :

      HTML 5 supports three types of video format:

      • mp4
      • webm
      • ogg

    18. Question 18. What Is The Difference Between Progress And Meter Tag?

      Answer :

      The progress tag is used to represent the progress of the task only while the meter tag is used to measure data within a given range.

    19. Question 19. Why It Is Important To Set The Meta Information?

      Answer :

      Metadata is the data about the data or the information about the data. There is a tag <meta> that is being provided for the HTML document. This information won't be displayed anywhere and will not be visible to the user. It will be parsable by the machine which will parse it according to the requirement. It consists of the elements that are related to the page description, keywords, document related element. The tag that is being used resides in the  section in HTML. The meta information is being used by the web browser or by the search engines to rank and let the user find the pages easily. 

    20. Question 20. Is There Any Way To Keep List Elements Straight In An Html File?

      Answer :

      By using indents, you can keep the list elements straight. If you indent each subnested list in further than the parent list that contains it, you can at a glance determine the various lists and the elements that it contains.

    21. Question 21. If You See A Web Address On A Magazine, To Which Web Page Does It Point?

      Answer :

      Every web page on the web can have a separate web address. Most of these addresses are relative to the top-most web page. The published web address that appears within magazines typically points this top-most page. From this top level page, you can access all other pages within the web site.

    22. Question 22. What Is The Use Of Using Alternative Text In Image Mapping?

      Answer :

      When you use image maps, it can easily become confusing and difficult to determine which hotspots corresponds with which links. Using alternative text lets you put a descriptive text on each hotspot link.

       

    23. Question 23. Is It Possible To Set Specific Colours For Table Borders?

      Answer :

      You can specify a border colour using style sheets, but the colours for a table that does not use style sheets will be the same as the text colour.

    24. Question 24. What Is The Use Of Span In Html And Give One Example?

      Answer :

      SPAN : Used for the following things:
      1. Highlight the any color text
      2. For adding colored text
      3. For adding background image to text.
      <p>
      <span style="color:#000000;">
      In this page we use span.
      </span>

    25. Question 25. What Is The Importance Of Doctype In Html?

      Answer :

      Doctype tag is not a HTML tag, it is just an instruction that is passed to the web browser to check for the information that is being provided by the markup language in which the page is written. Doctype is sometimes referred as Document type definition (DTD) that describes some rules that has to be followed while writing the markup language so to make the web browser understand the language and the content correctly. Doctype is very important to be placed in the beginning of the HTML and before the <HTML> tag to allow easy rendering of the pages that are used.

    26. Question 26. What Do You Know About Java?

      Answer :

      Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

    27. Question 27. What Are The Supported Platforms By Java Programming Language?

      Answer :

      Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc.

    28. Question 28. List Any Five Features Of Java?

      Answer :

      Some features include

      • Object Oriented
      • Platform Independent
      • Robust
      • Interpreted
      • Multi-threaded

    29. Question 29. Why Is Java Architectural Neutral?

      Answer :

      It’s compiler generates an architecture-neutral object file format, which makes the compiled code to be executable on many processors, with the presence of Java runtime system.

    30. Question 30. How Java Enabled High Performance?

      Answer :

      Java uses Just-In-Time compiler to enable high performance. Just-In-Time compiler is a program that turns Java bytecode, which is a program that contains instructions that must be interpreted into instructions that can be sent directly to the processor.

    31. Question 31. Why Java Is Considered Dynamic?

      Answer :

      It is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.

    32. Question 32. List Two Java Ide’s?

      Answer :

      • Netbeans 
      • Eclipse

    33. Question 33. Variables Used In A Switch Statement Can Be Used With Which Datatypes?

      Answer :

      Variables used in a switch statement can only be a string, enum, byte, short, int, or char.

    34. Question 34. What Is Protected Access Modifier?

      Answer :

      Variables, methods and constructors which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class.

    35. Question 35. What Do You Mean By Access Modifier?

      Answer :

      Java provides access modifiers to set access levels for classes, variables, methods and constructors. A member has package or default accessibility when no accessibility modifier is specified.

    36. Question 36. What Is A Static Variable?

      Answer :

      Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.

    37. Question 37. When A Byte Datatype Is Used?

      Answer :

      This data type is used to save space in large arrays, mainly in place of integers, since a byte is four times smaller than an int.

    38. Question 38. What Is The Default Value Of Float And Double Datatype In Java?

      Answer :

      Default value of float and double datatype in different as compared to C/C++. For float its 0.0f and for double it’s 0.0d

    39. Question 39. What Is The Default Value Of Byte Datatype In Java?

      Answer :

      Default value of byte datatype is 0.

    40. Question 40. List The Three Steps For Creating An Object For A Class?

      Answer :

      An Object is first declared, then instantiated and then it is initialized.

    41. Question 41. What Do You Mean By Constructor?

      Answer :

      Constructor gets invoked when a new object is created. Every class has a constructor. If we do not explicitly write a constructor for a class the java compiler builds a default constructor for that class.

    42. Question 42. What Is Singleton Class?

      Answer :

      Singleton class control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes.

    43. Question 43. What Is A Class Variable?

      Answer :

      These are variables declared with in a class, outside any method, with the static keyword.

    44. Question 44. What Is A Instance Variable?

      Answer :

      Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded.

    45. Question 45. What Is A Local Variable?

      Answer :

      Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and it will be destroyed when the method has completed.

    46. Question 46. Define Class?

      Answer :

      A class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

       

    47. Question 47. What Do You Mean By Object?

      Answer :

      Object is a runtime entity and it’s state is stored in fields and behavior is shown via methods. Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.

    48. Question 48. What Is Finalize() Method?

      Answer :

      It is possible to define a method that will be called just before an object's final destruction by the garbage collector. This method is called finalize( ), and it can be used to ensure that an object terminates cleanly.

    49. Question 49. Which Package Is Used For Pattern Matching With Regular Expressions?

      Answer :

      java.util.regex package

    50. Question 50. What Is The Difference Between Stringbuffer And Stringbuilder Class?

      Answer :

      Use StringBuilder whenever possible because it is faster than StringBuffer. But, if thread safety is necessary then use StringBuffer objects.

    51. Question 51. Why Is Stringbuffer Called Mutable?

      Answer :

      The String class is considered as immutable, so that once it is created a String object cannot be changed. If there is a necessity to make alot of modifications to Strings of characters then StringBuffer should be used.

    52. Question 52. How Can We Run Gwt Application?

      Answer :

      Two ways of running the application:
      1) Create a war file and deploy in any app server or
      2) Run ant hosted in the command prompt. And click on the ‘Launch Default Browser’.

    53. Question 53. Can We Set Css Style In Gwt Java Code?

      Answer :

      The look and feel of a GWT application can be customized via CSS files. Each widget in GWT can be given a HTML "div" container and can therefore be individually styled by CSS. You use the Java method setStyle(String s) for this.

    54. Question 54. What Are Modules, Entry Points And Html Pages In Gwt?

      Answer :

      GWT applications are described as modules. A module "modulename" is described by a configuration file "modulename.gwt.xml". Each module can define one or more Entry point classes.
      An entry point is the starting point for a GWT application, similar to the main method in a standard Java program. A Java class which is an entry point must implement the interface "com.google.gwt.core.client.EntryPoint" which defines the method onModuleLoad(). 
      The module is connected to a HTML page, which is called "host page". The code for a GWT web application executes within this HTML document. 
      The HTML page can define "div" containers to which the GWT application can assign UI components or the GWT UI components are simply assigned to the body tag of the HTML page.

       

    55. Question 55. How Many Modes Are Provided By Gwt To Execute Application?

      Answer :

      There are two modes: Development mode and Web mode.
      Development Mode: allows to debug the Java code of your application directly via the standard Java debugger. 
      Web mode: the application is translated into HTML and Javascript code and can be deployed to a webserver.

    56. Question 56. How Can You Set Browser Targeted Compilation In Gwt?

      Answer :

      •To reduce the compilation time, choose favorite browser and add the user.agent property in the module configuration file.
      Values: ie6,ie8,gecko1_8,safari,opera
      module.gwt.xml:
      <module..>
      <inherits...>
      <set property name="user.agent" value="ie8,opera">
      </module..>

       

    57. Question 57. How To Compile The Gwt Application?

      Answer :

      Run ant build in the root folder of the application. By default gwt compiler creates optimized JS files for some browsers. 
      : Disadvantage is it takes a lot of time to compile each change because of the permutations 
      Steps:
      1) Open command prompt
      2) Go to the application root folder
      3) Run command as "ant build"
      Then you can see compile logs are coming. If you see BUILD SUCCESSFUL it means no error in your application. If BUILD FAILED it means there is an error in your application.

    58. Question 58. How To Create A Gwt Application?

      Answer :

      •Create a folder for the application (e.g. withoutbook)
      •Run webAppCreator in the newly created folder
      –webAppCreator takes a module name (here 'withoutbook' is the module name with a package prefix)

    59. Question 59. What Is Gwt Rpc?

      Answer :

      • RPC, Remote Procedure Call is the mechansim used by GWT in which client code can directly executes the server side methods.
      • GWT RPC is servlet based.
      • GWT RPC is asynchronous and client is never blocked during communication.
      • Using GWT RPC Java objects can be sent directly between the client and the server (which are automatically serialized by the GWT framework).
      • Server-side servlet is termed as service.
      • Remote procedure call that is calling methods of server side servlets from client side code is referred to as invoking a service.

    60. Question 60. What Are The Core Components Of Gwt Rpc?

      Answer :

      Following are the three components used in GWT RPC communication mechanism:

      • A remote service (server-side servlet) that runs on the server.
      • Client code to invoke that service.
      • Java data objects which will be passed between client and server.
      • GWT client and server both serialize and deserialize data automatically so developers are not required to serialize/deserialize objects and data objects can travel over HTTP.

       

    61. Question 61. Which Interface A Java Data Object Should Implement So That It Can Be Transferred Over The Wire In Gwt Rpc?

      Answer :

      A java data object should implement isSerializable interface so that it can be transferred over the wire in GWT RPC.

    62. Question 62. What Is Internationalization?

      Answer :

      Internationalization is a way to show locale specific information on a website. For example, display content of a website in English language in United States and in Danish in France.

    63. Question 63. What Are The Ways Using Which You Can Internationalize A Gwt Application?

      Answer :

      GWT provides three ways to internationalize a GWT application −

      1. Static String Internationalization.
      2. Dynamic String Internationalization.
      3. Localizable Interface.

    64. Question 64. What Is Static String Internationalization Technique In Gwt?

      Answer :

      This technique is most prevalent and requires very little overhead at runtime; is a very efficient technique for translating both constant and parameterized strings;simplest to implement. Static string internationalization uses standard Java properties files to store translated strings and parameterized messages, and strongly-typed Java interfaces are created to retrieve their values.

    65. Question 65. What Is Dynamic String Internationalization Technique In Gwt?

      Answer :

      This technique is very flexible but slower than static string internationalization. Host page contains the localized strings therefore, applications are not required to be recompiled when we add a new locale. If GWT application is to be integrated with an existing server-side localization system, then this technique is to be used.

    66. Question 66. What Is Localizable Interface Internationalization Technique In Gwt?

      Answer :

      This technique is the most powerful among the three techniques. Implementing Localizable allows us to create localized versions of custom types. It's an advanced internationalization technique.

    67. Question 67. Which Tag Of *.gwt.xml Is Used To Support Internationalization In Gwt Application?

      Answer :

      extend-property tag with attribute name set as locale and values as language specific locale, say de for german locale.

       

    68. Question 68. What Is Simpleremoteloghandler In Gwt?

      Answer :

      This handler sends log messages to the server, where they will be logged using the server side logging mechanism.

    69. Question 69. What Is Popuploghandler In Gwt?

      Answer :

      PopupLogHandler logs to the popup which resides in the upper left hand corner of application when this handler is enabled.

       

    70. Question 70. What Is Firebugloghandler In Gwt?

      Answer :

      FirebugLogHandler logs to Firebug console.

    71. Question 71. What Is Consoleloghandler In Gwt?

      Answer :

      ConsoleLogHandler logs to the javascript console, which is used by Firebug Lite (for IE), Safari and Chrome.

    72. Question 72. What Is Developmentmodeloghandler In Gwt?

      Answer :

      DevelopmentModeLogHandler logs by calling method GWT.log. These messages can only be seen in Development Mode in the DevMode window.

       

    73. Question 73. What Is Systemloghandler In Gwt?

      Answer :

      SystemLogHandler logs to stdout and these messages can only be seen in Development Mode in the DevMode window.

    74. Question 74. How Can You Create A Custom Gwt Widget?

      Answer :

      GWT provides three ways to create custom user interface elements. There are three general strategies to follow −

      • Create a widget by extending Composite Class − This is the most common and easiest way to create custom widgets. Here you can use existing widgets to create composite view with custom properties.
      • Create a widget using GWT DOM API in JAVA − GWT basic widgets are created in this way. Still its a very complicated way to create custom widget and should be used cautiously.
      • Use JavaScript and wrap it in a widget using JSNI − This should generally only be done as a last resort. Considering the cross-browser implications of the native methods, it becomes very complicated and also becomes more difficult to debug.

    75. Question 75. What Is Gwt Uibinder?

      Answer :

      • The UiBinder is a framework designed to separate Functionality and View of User Interface.
      • The UiBinder framework allows developers to build gwt applications as HTML pages with GWT widgets configured throughout them.
      • The UiBinder framework makes easier collaboration with UI designers who are more comfortable with XML, HTML and CSS than Java source code.
      • The UIBinder provides a declarative way of defining User Interface.
      • The UIBinder seperates the programmic logic from UI.
      • The UIBinder is similar to what JSP is to Servlets.

Html Tutorial

Html, Gwt, Java Interview Questions

All Tutorials

All Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Tutorial