1~

Minter Coder's Blog

Chapter 2 - Soru 40/41

2021-03-18

40. Which of the following does not compile?
A. double num = 2.718;
B. double num = 2._718;
C. double num = 2.7_1_8;
D. None of the above; they all compile.

Hangisi derlenmez ? Bununla ilgili gerçekten bu chapterde 3-5 tane soru vardı hepsinde açıkladım şimdi de açıklayacam.Floating-point sayılarında şöyle oluyor olay;
double num = 2.718; // yapabilirsiniz;
double num = 2._718; // yapamazsınız ._ yan yana gelmez yada şöyle _. yada 2.7_18_; yapamazsınız sona gelmez yada _2.7_18; yapamazsınız başa da gelmez.;
double num = 2.7_1_8; // yapabilirsiniz.No problem.

Cevap B.


41. Which of the following lists of primitive numeric types is presented in order from
smallest to largest data type?
A. byte , short , int , long
B. int , short , byte , long
C. short , byte , int , long
D. short , int , byte , long

Numeric primitive typeların sırası;
byte,short,int,long şeklindedir.eğer floating-point sayılarını da dahil edersek byte,short,int,long,float,double.Cevap A.