Java nima Java dasturlash tili


Download 1.25 Mb.
bet6/49
Sana20.01.2023
Hajmi1.25 Mb.
#1103409
1   2   3   4   5   6   7   8   9   ...   49
Bog'liq
2 5420273372074344755

class A{

  • int data=50;//instance variable

  • static int m=100;//static variable

  • void method(){

  • int n=90;//local variable

  • }

  • }//end of class 

    Javada ma’lumot turlari (data types)
    Javada ma’lumotlar turlari 2 ta
    1. Soda(primitive )
    2. Soda bo’lmagan (non primitive)



    public class Varibles {


    public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println(Character.SIZE / 8 + " byte");
    System.out.println(Byte.SIZE / 8 + " byte");
    System.out.println(Short.SIZE / 8 + " byte");
    System.out.println(Integer.SIZE / 8 + " byte");
    System.out.println(Long.SIZE / 8 + " byte");
    System.out.println(Float.SIZE / 8 + " byte");
    System.out.println(Double.SIZE / 8 + " byte");
    }
    }

    Java dasturlash tilida eng ko’p ishlatilardigan operatorlar (solishtirish operatorlari, mantiqiy operatorlar, o‘zlashtirish operatori)


    Solishtirish operatori
    Ikki operatorni bir-biri bilan solishtirishda ishlatialdi. Odatda, solishtirish operatorlar, shart berish operatori(if) va sikl(while for) ammalari bilan ishlatialdi.
    Bu aperatrlar ikki xil natija qaytarishi mumkin true yokiy false
    Java dasturlash tilida quyidagi solishtirish operatorlari mavjud:
    == -> teng
    != -> teng emas
    > -> katta
    < -> kichik
    >= -> katta yokiy teng
    <= -> kichik yokiy teng
    public class CompareOperators {
    public static void main(String[] args) {
    int a = 3;
    int b = 6;

    Download 1.25 Mb.

    Do'stlaringiz bilan baham:
  • 1   2   3   4   5   6   7   8   9   ...   49




    Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
    ma'muriyatiga murojaat qiling