1 / 16

مراجعة

مراجعة. Jave programming language. ما هي المخرجات للاكواد التالية ؟. class Hello { public static void main(String []arg) { System.out.println("Hello"); } }. Hello. byte b = 5 ; سنكتب الان برنامج نعلن فيه عن هذا المتغير ونطبعه class DataType {

hina
Télécharger la présentation

مراجعة

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. مراجعة Jave programming language أ.حنين عبدالرحمن برمجة 2

  2. ما هي المخرجات للاكواد التالية ؟ class Hello { public static void main(String []arg) { System.out.println("Hello"); } } Hello أ.حنين عبدالرحمن برمجة 2

  3. byte b = 5 ; سنكتب الان برنامج نعلن فيه عن هذا المتغير ونطبعه class DataType { public static void main(String []arg) { byte b=5; System.out.println("byte b ="+b); } } byte b =5 أ.حنين عبدالرحمن برمجة 2

  4. class DataType { public static void main(String []arg) { short s=100 ; inti=10000 ; long L=1000000000; float d=105.55f ; char c='G'; boolean state=false; System.out.println("s="+s+"\t"+"i="+i+"\n"+"L="+L+"\t"+"d="+d+"\n"+"c=" c+"\t"+"state="+state); } } s=100 i=10000 L=1000000000 d=105.55f c=G sate=false أ.حنين عبدالرحمن برمجة 2

  5. class UnaryOper { public static void main(String []arg) { inta,b,i,j; i=j=5; a=i++ * 3; b=++j *3; System.out.println("a = "+a+"\n"+"b = "+b); } } a=15 b=18 أ.حنين عبدالرحمن برمجة 2

  6. class LogOper { public static void main(String []arg) { boolean b1,b2,b3,b4; inti=7; float f=5.5f; char c='w'; b1=(i>=6)&&(c==119); b2= (i>6)||(c=='w'); b3=(f<11)&&(i>100); b4=(c!='p')||((i+f)<=10); System.out.println("(i>=6)&&(c==119) is "+b1); System.out.println("(i>6)||(c=='w') is "+b2); System.out.println("(f<11)&&(i>100) is "+b3); System.out.println("(c!='p')||((i+f)<=10) is "+b4); } } أ.حنين عبدالرحمن برمجة 2

  7. class AssOper { public static void main(String []arg) { inti=6,j=8; float f=6.5f,k=-4.25f; System.out.println("i=i+6 -> i="+(i+=6)); System.out.println("f=f-k -> f= "+(f-=k)); System.out.println("j=j*(i-4) -> j="+(j*=(i-4))); System.out.println("f=f/4 -> f="+(f/=4)); System.out.println("i=i%(j-2) -> i="+(i%=(j-2))); } } أ.حنين عبدالرحمن برمجة 2

  8. class WhileSt { public static void main(String []arg) { inti=0; while (i<=7) { System.out.println(i); ++i; } } } أ.حنين عبدالرحمن برمجة 2

  9. class WhileSt2 { public static void main(String []arg) { int i=0; while (++i<=7); System.out.println(i); } } أ.حنين عبدالرحمن برمجة 2

  10. class WhileSt3 { public static void main(String []arg) { intb,a=0; while (a<=10) { b=1; while(b<=a) { System.out.print ("*"); ++b; } System.out.print ("\n"); ++a; } } } أ.حنين عبدالرحمن برمجة 2

  11. class WhileSt4 { public static void main(String []arg) { int a=1; int b; while (true) { b=1; while(b<=a) { System.out.print(a); ++b; } System.out.print("\n"); ++a; } } } أ.حنين عبدالرحمن برمجة 2

  12. ctrl+c وللخروج من هذه الحلقة اللانهائية اضغط مفتاحى أ.حنين عبدالرحمن برمجة 2

  13. class DoWhileSt4 { public static void main(String []arg) { inti=0; do { System.out.println("HI"); ++i; } while(i>7); } } أ.حنين عبدالرحمن برمجة 2

  14. class ForSt { public static void main(String []arg) { inti; for(i=0;i<=10;++i) { System.out.println(i+"\t"+(i*10)+"\t"+(i*100)+"\t"+(i*1000)); } } } أ.حنين عبدالرحمن برمجة 2

  15. أ.حنين عبدالرحمن برمجة 2

  16. END  أ.حنين عبدالرحمن برمجة 2

More Related