Arjun Thakur has Published 1025 Articles

Execute a script when the file is unavailable in HTML?

Arjun Thakur

Arjun Thakur

Updated on 03-Mar-2020 09:51:09

204 Views

Use the onemptied attribute in HTML to execute a script when the file is unavailable in HTML or it is empty.ExampleYou can try to run the following code to implement the onemptied attribute −                              Your browser does not support the video element.                      function display()          {             alert ("Sorry! Empty playlist!");          }          

Create a paragraph with a right-to-left direction in HTML5

Arjun Thakur

Arjun Thakur

Updated on 03-Mar-2020 05:38:02

352 Views

Use the dir attribute in HTML to set a paragraph with right-to-left direction. Add the value rtl to the dir attribute for the text to be placed from right-to-left.ExampleYou can try to run the following code to implement dir attribute −           This is demo paragraph. ... Read More

How do we set the text direction for the content in an element in HTML?

Arjun Thakur

Arjun Thakur

Updated on 03-Mar-2020 05:29:57

218 Views

Use the dir attribute in HTML, to set the text direction for the content in an element. You can try to run the following code to implement dir attribute −Example           This is demo text from left-to-right.       This is demo text from right-to-left.    

How do we display the visible width of a text area in HTML?

Arjun Thakur

Arjun Thakur

Updated on 03-Mar-2020 05:26:22

192 Views

Use the cols attribute in HTML to display the visible width of a textarea. You can try to run the following code to implement cols attribute −Example                    This is a demo paragraph. This is a demo paragraph.          This is a demo paragraph. This is a demo paragraph.          

How to start object-oriented programming in C++?

Arjun Thakur

Arjun Thakur

Updated on 02-Mar-2020 08:09:42

872 Views

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of attributes; and instructions to do things, in the form of methods.For example, a person is an object which has certain properties such as height, gender, age, etc. It also ... Read More

What are POD types in C++?

Arjun Thakur

Arjun Thakur

Updated on 02-Mar-2020 07:55:47

1K+ Views

POD is an acronym in C++ that means plain old data. It is a class/struct that ONLY has member variables and no methods, constructors, destructors, virtual functions, etc. For example, Example#include using namespace std; // POD struct MyStruct {     int key;     string data; }; int main() ... Read More

What is a string literal in C++?

Arjun Thakur

Arjun Thakur

Updated on 27-Feb-2020 05:08:03

538 Views

A string literal or anonymous string is a type of literal in programming for the representation of a string value within the source code. More simply put, a string literal is a bit of text between double quotes. For example, const char* var = "Hello";In this definition of var, "Hello" ... Read More

Java String intern() method example.

Arjun Thakur

Arjun Thakur

Updated on 26-Feb-2020 08:08:51

193 Views

The intern() method of the String class returns a canonical representation for the string object. It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.ExampleLive Demoimport java.io.*; public class Test {    public static void main(String args[]) {   ... Read More

What does the compareTo do in Java?

Arjun Thakur

Arjun Thakur

Updated on 26-Feb-2020 07:07:03

203 Views

The compareTo() method in Java compares two strings lexicographically.ExampleLive Demopublic class Test {    public static void main(String args[]) {       String str1 = "Strings are immutable";       String str2 = new String("Strings are immutable");       String str3 = new String("Integers are not immutable"); ... Read More

Why StringBuffer is mutable in Java?

Arjun Thakur

Arjun Thakur

Updated on 26-Feb-2020 06:01:26

2K+ Views

We all know that the String class in Java is mutable i.e. once we create a String variable we cannot modify its data or do any manipulations.But, there may be scenarios where we need to modify the data of String variables. In such cases, we could use StringBuffer class.This class ... Read More

Advertisements