Seetha has Published 104 Answers

How do we use checkbox buttons in HTML forms?

seetha

seetha

Updated on 17-Jun-2020 13:47:06

Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.Let’s learn about how to use radio checkbox in HTML forms to get user ... Read More

How to return 2 values from a Java method

seetha

seetha

Updated on 17-Jun-2020 11:32:59

A method can give multiple values if we pass an object to the method and then modifies its values. See the example below −Examplepublic class Tester {    public static void main(String[] args) {       Model model = new Model();       model.data1 = 1;     ... Read More

Rules for Java method overriding

seetha

seetha

Updated on 17-Jun-2020 07:07:22

Following are the rules we should consider while overriding a method properly −The argument list should be exactly the same as that of the overridden method.The return type should be the same or a subtype of the return type declared in the original overridden method in the superclass.The access level ... Read More

How to create an unordered list with image bullets in HTML?

seetha

seetha

Updated on 16-Jun-2020 13:43:17

To create unordered list in HTML, use the <ul> tag. The unordered list starts with the <ul> tag. The list item starts with the <li> tag and will be marked as disc, square, circle, etc. The default is bullets, which is small black circles. If you want to create an ... Read More

How to use void keyword in JavaScript?

seetha

seetha

Updated on 16-Jun-2020 13:07:54

The void is an important keyword in JavaScript, which can be used as a unary operator that appears before its single operand, which may be of any type. This operator specifies an expression to be evaluated without returning a value.The syntax of the void can be either of the following ... Read More

What is cross-browser window resize events in JavaScript?

seetha

seetha

Updated on 16-Jun-2020 12:05:49

For window resize event in JavaScript, use addEventListener(). The following code will give you the size of the current window −ExampleLive Demo<!DOCTYPE html> <html>    <head>       <style>          div {             margin-top: 10px;             ... Read More

How to set cookies to expire in 1 hour in JavaScript?

seetha

seetha

Updated on 16-Jun-2020 11:47:42

You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the ‘expires’ attribute to a date and time.ExampleYou can try to run the following example to set cookies ... Read More

What is the difference between static classes and non-static inner classes in Java?

seetha

seetha

Updated on 16-Jun-2020 09:10:13

Following are the notable differences between inner classes and static inner classes.Accessing the members of the outer classThe static inner class can access the static members of the outer class directly. But, to access the instance members of the outer class you need to instantiate the outer class.Examplepublic class Outer ... Read More

Preventing an image from being draggable or selectable in HTML without using JS

seetha

seetha

Updated on 01-Jun-2020 10:44:14

Add the following code snippet to image properties, and prevent images from being dragged and selected.img {      user-drag: none;      user-select: none;    -moz-user-select: none;    -webkit-user-drag: none;    -webkit-user-select: none;    -ms-user-select: none; }On double click on a text or image, it is highlighted (selected). The ... Read More

How do we add a sample computer code in HTML?

seetha

seetha

Updated on 29-May-2020 23:04:24

Use the <samp> tag to display a sample computer code. The HTML <samp> tag is used to display the output of a computer program.ExampleYou can try to run the following code to implement <samp> tag in HTML −<!Doctype html> <html>    <head>       <title>HTML samp Tag</title>    </head> ... Read More

Advertisements