“Casting di Java” Kode Jawaban

Casting tipe Java

public class Main {
  public static void main(String[] args) {
    int myInt = 9;
    double myDouble = myInt; // Automatic casting: int to double

    System.out.println(myInt);      // Outputs 9
    System.out.println(myDouble);   // Outputs 9.0
  }
}
The Cat Coder

Casting tipe Java

Lowest to highest primitive data types: Byte-->Short-->Int-->Long-->Float-->Double
Sandeep Choudhary

= casting operator di java

    int x = 0;
    x += 1.1;    // just fine; hidden cast, x == 1 after assignment
    x = x + 1.1; // won't compile! 'cannot convert from double to int'
Selfish Seahorse

Casting di Java

Byte-->short-->char-->Int-->long-->float-->double
Blue-eyed Barracuda

Jawaban yang mirip dengan “Casting di Java”

Pertanyaan yang mirip dengan “Casting di Java”

Lebih banyak jawaban terkait untuk “Casting di Java” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya