Defining the Main Method public


Download 15.35 Kb.
Sana05.01.2022
Hajmi15.35 Kb.
#220589
Bog'liq
Java Learning Notes


Defining the Main Method

public is an access modifier. An access modifier allows us to define the scope or how other parts of your code or even some else’s code can access this code.

static is a Java keyword that needs an understanding of other concepts, for now, know that we need to have static for java to find our method to run the code we are going to add.

void is yet another java keyword used to indicate that the method will not return anything.

Java operators or just operators perform an operation (hence the word) on a variable or value +, -, /

and * are four common ones.



Casting means to treat or convert a number from one type to another. We put the type we want number to be in parenthesis like this: (byte) (MinByteValue/2);

String is a datatype in Java, which is not a primitive type. It’s actually a Class, but it enjoys a bit of favoritism in Java to make it easier to use than a regular class.

Difference between OR/AND:

OR – kiritilgan qiymatning o’ng yoki chap tarafini true/false ga tekshiradi;

AND – kiritligan ifodaning ikkala tomonini ham true/false ga tekshiradi;
Expressions – int score = 50; score = 50; System.out.prinln(“You got the high score!”);

if (score > 10) –they are expressions.


Statements – They are the whole line till semi-colon(;).

int score = 50;

score = 50;

System.out.prinln(“You got the high score!”);

Data Types – They are all The Java Keyword like (int, double, if, float, else and etc.).

Java Keywords could be found here: https://en.wikipedia.org/wiki/List_of_Java_keywords.

Java Exercises could be found here: https://www.w3resource.com/java-exercises/basic/index.php.

Indenting – bu yasalgan ko’dning chiroyli(o’qiladigan) holatda jo’ylashuvi.

DiffMerge – bu yasagan ko’dingizda yo’l qo’yilgan mantiqiy va orfografik(Javaga oid) xatolarni to’g’irlab berish uchun xizmat qiladigan ilova.




O’zgaruvchi elementlari va ularning min va max qiymatlari.

int[-2147483648; 2147483647] – faqatgina butun sonli o’zgaruvchilarni o’z ichiga oladi. 32bit

byte[-128; 127] – faqatgina butun sonli o’zgaruvchilarni o’z ichiga oladi; 8bit

short[-32768; 32767] – faqatgina butun sonli o’zgaruvchilarni o’z ichiga oladi; 16bit

float – asosan kasr sonli o’zgaruvchilarni o’z ichiga oladi va butundan keyin maksimum 7ta sonni o’z ichiga oladi; masalan: 1.1234567;

double – asosan kasr sonli o’zgaruvchilarni o’z ichiga oladi va butundan keyin maksimum 16ta sonni o’z ichiga oladi; masalan: 1.1234567898765432; 32bit

char – bu raqam va harflarning kod variantida ifodalangan holati. Bitta char elementi uchun bitta Unicode berilishi kerak;

Unicode – Bu raqam va harflarning ko’d variantidagi ifodasi;

boolean – bu element faqatgina 2xil qiymatni qabul qila oladi, yani True, False yoki Yes, No yoki 1 va 0;

String – bu element Javada raqamlarni emas so’zlar va/yoki harflarni ifodalaydi, qo’shimcha qilib aytganda, so’zlar ifodasidagi harakterlarni bir biriga taqqoslash yoki tenglash;

If-thenx

\u0044A9
Download 15.35 Kb.

Do'stlaringiz bilan baham:




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