Programlama | Programlama Dilleri | C Programlama Dili |C++

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character
Anasayfa Programlama Java Kare Fonksiyonu


Kare Fonksiyonu

AIKLAMA

1 den 10'a kadar say?lar?n karelerini hesaplayan bir Applet uygulamasidir.

Program Kodu:

  1. public class KareHesapla extends JApplet {
  2. JTextArea text=new JTextArea();
  3. String y="";
  4. public int karehesapla(int x)
  5. {
  6. int sonuc=x*x;
  7. return sonuc;
  8. }
  9. public void init()
  10. {
  11.  
  12. for(int i=1;i<=10;i++)
  13. {
  14. int tut=karehesapla(i);
  15. y+=i+" say?s?n?n karesi: "+tut;
  16. y+="\n";
  17. }
  18. }
  19.  
  20. public void paint(Graphics g)
  21. {
  22. Container container=getContentPane();
  23. container.add(text);
  24. super.paint(g);
  25. text.setText(y);
  26. }
  27.  
  28. }

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Cuma, 08 Nisan 2011 00:11 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.