casting tag

14 questions


1 answers
147 views
0
+= operator in Java

As far as I know, i+=j; and i=i+j have the same meaning int i = 5; long j = 8;If I = i+j;, it can't be compiled. If I = j;, it runs well I wonder why.


1 answers
92 views
0
How can I determine if the string is a number (integer plus real numbers) in Python?

If you use isdigit(), only the integer is true, and the real type shows FalseI don't think there's anything like isfloat() what should I do?


1 answers
78 views
0
How can I safely convert long into int in Java?

What is the best way to avoid data loss when converting from long to int?public static int safeLongToInt(long l) { int i = (int)l; if ((long)i != l) { throw new IllegalArgumentException(l + cannot b...

2 years ago

1 answers
139 views
0
Is it possible to cast int as enum in Java?

public enum MyEnum{ EnumValue1, EnumValue2}MyEnum enumValue = (MyEnum) x; //Doesn't work???How can I cast int as enum?

2 years ago

1 answers
144 views
0
How do I change boolean to int?

What is the best way to change boolean to int?

2 years ago

1 answers
156 views
0
How do I cast an object as int in Java?

I want to cast an object as int. How do I do it

2 years ago

1 answers
134 views
0
Python type conversion

I'd like to change the value received by crawling the website to int with the string ex : 1,551 consisting of numbersI don't think I can convert to int because of comma.error message : Could not conve...

2 years ago

2 answers
153 views
0
Here's a question for Java class conversion!

I am studying Java again, and I am posting a question because I have a question.public class super{ public int one= 11; public int two= 22; public void one_method() { System.out.println(super one_met...

2 years ago

1 answers
138 views
0
The method used in a variable for statement numbered in the python name.

Hello, everyone I'm running Python on Jupiter laptop I'm asking because I'm not sure how to write a for statement for a variable.The variables are from Year1 to Year10.# Year1 type conversion index = ...


1 answers
78 views
0
I have a question about float 4byte data.

iobyte[0][0] = 44 , iobyte[0][1] = e8 , iobyte[0][2] = 35 , iobyte[0][3] = 42There is data that came in in the same form as Let's say 44e83542 in which the value of the float's real stored form is seq...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.