Questions tagged as 'cast'

5
answers

What is the difference between an explicit cast and the as operator?

Always when I convert an object to a specific type, I use an explicit cast , for example: private void textBox1_Leave(object sender, EventArgs e) { TextBox textBoxTemp = (TextBox)sender; MessageBox.Show("Você digitou: " + textBoxTemp....
asked by 22.01.2015 / 19:21
2
answers

What is upcasting and downcasting in the Java language?

What would be downcasting and upcasting in Java? Examples please.     
asked by 29.05.2016 / 02:46
2
answers

What's the difference between using (int) variable or Convert.ToInt32 (variable)?

What's the difference between them? When is it best to use one or the other? Examples: string palavra = "10"; var numero = Convert.ToInt32(palavra); // ou (int)palavra ? string palavra2 = "10.50"; var numero2 = (double)palavra2; // ou Conv...
asked by 06.10.2015 / 15:39
1
answer

Difference between casting and promotion

What is casting ? What is promotion ? What is the basic difference between these types of Java translation?     
asked by 07.12.2015 / 11:40
7
answers

Format decimal places directly in the SQL command in Firebird

I have a ESTOQUE table containing a field called QTDE , this field has 3 decimal places. What would be the command to return straight from SQL formatted with 3 houses? Because the whole values are returning without the houses....
asked by 31.01.2014 / 14:04
2
answers

How to get the integer value of one of the constants of an enum?

I have an enum (enumeration) calling Notas and I need to get the integer corresponding to one of its constants. public enum Nota { Otimo = 5, MuitoBom = 4, Bom = 3, Regular = 2, Ruim = 1, Insuficiente = 0 } I...
asked by 15.12.2013 / 03:22
2
answers

CAST: difference between "(String) arg" and "String.class.cast (arg)"

I wonder if there is a difference between: String a = (String) arg; and cast class: String a = String.class.cast(arg); I once heard that using the static cast class is more performative, is this true?     
asked by 06.07.2015 / 14:20
2
answers

What does this piece of cast code do?

code taken from Linux x86_64 execve Shellcode #include<stdio.h> #include<string.h> unsigned char code[] = \ "\x48\x89\xc6" // mov %rax,%rsi "\x48\x89\xf2" // mov %rsi,%rdx "\x49\...
asked by 21.06.2016 / 22:08
1
answer

Rounding as a result of multiplication

I have this scenario:  - do a multiplication of 2 values that will be rounded to 2 boxes for the table that will be inserted its result. Follow the example: CREATE TABLE #TMP ( A DECIMAL(23,6), B DECIMAL(28,2) ) INSERT INTO #TMP VAL...
asked by 05.01.2016 / 20:58
2
answers

Difference cast using "as" and "type cast"

A question about casting in C #, I see in many sources using cast in the following ways. What's the difference between one and the other when using one way or another? public interface InterfaceTeste { int Id { get; set; } } public...
asked by 23.03.2018 / 20:28