Syed Javed

Syed Javed

11 Articles Published

Articles by Syed Javed

11 articles

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

Syed Javed
Syed Javed
Updated on 17-Mar-2026 2K+ Views

In C#, the sizeof operator is commonly used to determine the size of a value type in bytes. However, there are alternative approaches to find the size of a variable without using sizeof, such as using the BitConverter class or Marshal.SizeOf method. Syntax Using sizeof operator − int size = sizeof(dataType); Using BitConverter.GetBytes() method − byte[] dataBytes = BitConverter.GetBytes(variable); int size = dataBytes.Length; Using Marshal.SizeOf() method − int size = Marshal.SizeOf(typeof(dataType)); Using BitConverter.GetBytes() Method The BitConverter.GetBytes() method converts a value to its byte array representation. ...

Read More

How to change font size in HTML?

Syed Javed
Syed Javed
Updated on 15-Mar-2026 134K+ Views

To change the font size in HTML, use the CSS font-size property. You can apply it using the style attribute for inline styles, internal CSS with the tag, or external CSS files. HTML5 does not support the deprecated tag, so CSS is the modern approach. Keep in mind that inline styles using the style attribute override any global styles set in tags or external stylesheets. Using Inline Styles The simplest method is using the style attribute directly on HTML elements: ...

Read More

:active pseudo class in CSS

Syed Javed
Syed Javed
Updated on 15-Mar-2026 838 Views

The CSS :active pseudo-class represents an element that is being activated by the user. This occurs during the brief moment when the element is being clicked or pressed, typically on links, buttons, or any clickable element. Syntax selector:active { property: value; } Example 1: Active Link Color The following example changes the link color to green when clicked − a:active { color: green; } ...

Read More

CURL context options in PHP

Syed Javed
Syed Javed
Updated on 15-Mar-2026 488 Views

In PHP, CURL context options allow you to configure HTTP and FTP requests when using stream contexts with functions like file_get_contents() or fopen(). These options provide fine-grained control over request behavior without directly using the cURL extension. Note: CURL context options are available when the CURL extension was compiled using the --with-curlwrappers configure option (deprecated in newer PHP versions). Available CURL Context Options Option Description method HTTP method supported by the remote server. Defaults to GET. header Additional headers to be sent during request ...

Read More

How is down-casting possible in Java?

Syed Javed
Syed Javed
Updated on 11-Mar-2026 230 Views

Yes, a variable can be downcast to its lower range substitute by casting. It may lead to data loss although. See the example below −Examplepublic class Tester {      public static void main(String[] args) {       int a = 300;         byte b = (byte)a;         System.out.println(b);    }   }OutputIt will print output as −44

Read More

Local variables in Java

Syed Javed
Syed Javed
Updated on 11-Mar-2026 2K+ Views

Local variables are declared in methods, constructors, or blocks.Local variables are created when the method, constructor or block is entered and the variable will be destroyed once it exits the method, constructor, or block.Access modifiers cannot be used for local variables.Local variables are visible only within the declared method, constructor, or block.Local variables are implemented at stack level internally.There is no default value for local variables, so local variables should be declared and an initial value should be assigned before the first use.ExampleHere, age is a local variable. This is defined inside pupAge()method and its scope is limited to only ...

Read More

Fibonacci series program in Java without using recursion.

Syed Javed
Syed Javed
Updated on 11-Mar-2026 4K+ Views

Following is the required program.Examplepublic class Tester {    public static void main(String args[]) {        int n1 = 0, n2 = 1, n3, i, max = 5;        System.out.print(n1 + " " + n2);        for (i = 2; i < max; ++i) {           n3 = n1 + n2;           System.out.print(" " + n3);           n1 = n2;           n2 = n3;        }     }  }Output0 1 1 2 3

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 10K+ Views

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; +--------+-------------+------+-----+---------+-------+ | Field  | Type        | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | Id     | int(11)     | YES  |     | NULL    |       | | Name   | varchar(20) | YES  |     | NULL ...

Read More

Advantages of naming conventions in Java

Syed Javed
Syed Javed
Updated on 06-Mar-2020 648 Views

Following the the best practices while declaring a variable. These best practices maintains code readability, understandability as project code size increases.Variables names should be short or long enough as per the scope. For example, loop counter variable, i is fine whereas employee as loop variable.Specific words should not be used like equals, compare, data.Use meaningful names which can explain the purpose of the variable. For example cnt Vs counter.Don't use _ to declare a variable name, Use camel casing. For example, employeeName is better than employee_name.Each organization has its own syntax specific standards. Follow those rules to maintain consistency ...

Read More

How the Table statement works in ABAP

Syed Javed
Syed Javed
Updated on 30-Jul-2019 432 Views

With table statement, you are able to get a single line of data corresponding to the dictionary structure you specify. The fields of structure can be used as select options and the structure can be passed as variable in the program.

Read More
Showing 1–10 of 11 articles
« Prev 1 2 Next »
Advertisements