“berbagai jenis variabel di java” Kode Jawaban

ketik variabel java

public class A  
{  
    static int m=100;//static variable  
    void method()  
    {    
        int n=90;//local variable    
    }  
    public static void main(String args[])  
    {  
        int data=50;//instance variable    
    }  
}//end of class   
abdullah

berbagai jenis variabel di java

// String - stores text, such as "Hello". String values are surrounded by double quotes
String str = "Hello";
// int - stores integers (whole numbers), without decimals, such as 123 or -123
int nbr = 0;
// float - stores floating point numbers, with decimals, such as 19.99 or -19.99
float pie = 3.141592;
// char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
char letter = "A";
// boolean - stores values with two states: true or false
boolean checker = true;
JC

Jawaban yang mirip dengan “berbagai jenis variabel di java”

Pertanyaan yang mirip dengan “berbagai jenis variabel di java”

Lebih banyak jawaban terkait untuk “berbagai jenis variabel di java” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya