Syed Javed has Published 47 Answers

CURL context options in PHP

Syed Javed

Syed Javed

Updated on 13-Nov-2020 12:18:12

IntroductionCURL context options are available when the CURL extension was compiled using the --with-curlwrappers configure option. Given below is list of CURL wrapper context optionsMethodDescriptionmethodHTTP method supported by the remote server. Defaults to GET.headerAdditional headers to be sent during requestuser_agentValue to send with User-Agent: header.contentAdditional data to be sent after ... Read More

vars() function in Python

Syed Javed

Syed Javed

Updated on 30-Jun-2020 08:13:57

vars() function belongs to the collection of inbuilt functions provided by the Python standard library. It returns the __dic__ attribute of an associated object to the console.Syntaxvars(object)Return Type<Dictionary Type>Parametersvars() function accepts only one parameter. It takes an object as its parameter which can be any module, class or any object ... Read More

:active pseudo class in CSS

Syed Javed

Syed Javed

Updated on 23-Jun-2020 15:41:33

Pseudo class is to show different state of an element or a css selector. Active pseudo class is to show that the element is in active state.This pseudo class is mostly being associated with link and button or any other element which can be active.For example if it is associated ... Read More

How to find the size of a variable without using sizeof in C#?

Syed Javed

Syed Javed

Updated on 23-Jun-2020 08:17:47

To get the size of a variable, sizeof is used.int x; x = sizeof(int);To get the size of a variable, without using the sizeof, try the following code −// without using sizeof byte[] dataBytes = BitConverter.GetBytes(x); int d = dataBytes.Length;Here is the complete code.Example Live Demousing System; class Demo {   ... Read More

What are the properties of an array object in JavaScript?

Syed Javed

Syed Javed

Updated on 19-Jun-2020 13:18:59

The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type.The following is the list of the properties of the Array object −Sr.NoProperty & Description1constructorReturns a reference to the array function that created the object.2indexThe property represents ... Read More

How to create an array of integers in JavaScript?

Syed Javed

Syed Javed

Updated on 19-Jun-2020 13:18:10

To create an array of integers in JavaScript, try the following −var rank = [1, 2, 3, 4];You can also use the new keyword to create array of integers in JavaScript −var rank = new Array(1, 2, 3, 4);The Array parameter is a list of strings or integers. When you specify ... Read More

How can we set PRIMARY KEY on multiple columns of an existing MySQL table?

Syed Javed

Syed Javed

Updated on 19-Jun-2020 11:56:21

We can set PRIMARY KEY constraint on multiple columns of an existing table by using ADD keyword along with ALTER TABLE statement.ExampleSuppose we have a table ‘Room_allotment’ as follows −mysql> Create table Room_allotment(Id Int, Name Varchar(20), RoomNo Int); Query OK, 0 rows affected (0.20 sec) mysql> Describe Room_allotment; +--------+-------------+------+-----+---------+-------+ ... Read More

What is the purpose of private constructor in Java?

Syed Javed

Syed Javed

Updated on 18-Jun-2020 07:56:40

The private constructor is useful in case we want to restrict the object creation. For example, Singleton pattern can be implemented using a private constructor.ExampleLive Demopublic class Tester {    private static Tester instance;    private Tester(){}      public static Tester getInstance(){       if(instance == null){   ... Read More

Can we overload Java main method?

Syed Javed

Syed Javed

Updated on 18-Jun-2020 07:47:37

Yes, we can overload the main method of Java. But JVM will only call the default main method only. See the example below.ExampleLive Demopublic class Tester {    public static void main(String args[]) {      System.out.println("Default Main");      }      public static void main(String args) {   ... Read More

Best practices for Java comments.

Syed Javed

Syed Javed

Updated on 18-Jun-2020 07:10:19

Java supports single-line, multi-line comments and documentation comments. Documentation comments are understood by javadoc tool and can be used to create HTML based documentation. Following are the best practices while using comments in Java.Use documentation comments, whenever you want its documentation to be generated. Multi-line comments are used to comments out ... Read More

Advertisements