8 Ekim Java

  • Uploaded by: gül
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 8 Ekim Java as PDF for free.

More details

  • Words: 480
  • Pages: 6
class Prizma { double en; double boy; double y�kseklik; void hacim(){ System.out.println("hacim="); System.out.println(en*boy*y�kseklik); } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(); double hacim; pr1.en=1; pr1.boy=5; pr1.y�kseklik=2; pr1.hacim(); hacim=pr1.en*pr1.boy*pr1.y�kseklik;

}

pr2.en=1; pr2.boy=5; pr2.y�kseklik=2; pr2.hacim(); hacim=pr2.en*pr2.boy*pr2.y�kseklik; System.out.println("hacim="+ hacim);

} ********************************************************************************** ******************** class Prizma { double en; double boy; double y�kseklik; double hacim(){ return en*boy*y�kseklik; } void degerler(double e,double b,double y) { en=e; boy=b; y�kseklik=y; } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(); pr1.degerler(10, 5, 15); System.out.println(pr1.hacim());

}

pr2.degerler(1, 5, 3); System.out.println(pr2.hacim());

} ********************************************************************************** **************************** class Prizma { double en; double boy; double y�kseklik; Prizma(){ en=10; boy=20; y�kseklik=5; } // kurucu constructor Prizma(double e,double b,double y){ en=e; boy=b; y�kseklik=y; } double hacim(){ return en*boy*y�kseklik; } void degerler(double e,double b,double y) { en=e; boy=b; y�kseklik=y; } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(5,1,2); System.out.println(pr1.hacim());

}

System.out.println(pr2.hacim());

} ********************************************************************************** ***************** class Prizma { double en; double boy; double y�kseklik; Prizma(){ en=10; boy=20; y�kseklik=5; } // kurucu constructor Prizma(double e,double b,double y){ this.en=e;// bulundugumuz nesnenn s�n�f�n formun takma ad�d�r boy=b; y�kseklik=y; } double hacim(){ return en*boy*y�kseklik; } void degerler(double e,double b,double y) { en=e; boy=b; y�kseklik=y; } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(5,1,2); System.out.println(pr1.hacim());

}

System.out.println(pr2.hacim());

} ********************************************************************************** ****************************************** class Prizma { double en; double boy; double y�kseklik; Prizma(){ en=10; boy=20;

y�kseklik=5; } // kurucu constructor Prizma(double en,double boy,double y�kseklik){ this.en/*bu s�n�fa ait*/=en kurucuda tan�mlanan en; this.boy=boy; this.y�kseklik=y�kseklik; } double hacim(){ return en*boy*y�kseklik; } void degerler(double e,double b,double y) { en=e; boy=b; y�kseklik=y; } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(5,1,2); System.out.println(pr1.hacim());

}

System.out.println(pr2.hacim());

} ********************************************************************************** ******************* class AsiriYukleme{ void deneme(){ System.out.println("deneme yap�yoruz"); } void deneme(int a){ System.out.println("a="+a); } void deneme(double a){ System.out.println("double a="+ a); } void deneme(int a,int b){ System.out.println("a+b="+ a+b); } } public class uygulama2 { public static void main(String[] args) { AsiriYukleme salla=new AsiriYukleme(); salla.deneme(); salla.deneme(5);

salla.deneme(3.56); salla.deneme(3,5); } } ********************************************************************************** ************* class Prizma { double en; double boy; double y�kseklik; Prizma(){ en=10; boy=20; y�kseklik=5; } // kurucu constructor Prizma(double e,double b,double y){ en=e; boy=b; y�kseklik=y; } Prizma(double kenar){ en=boy=y�kseklik=kenar; } double hacim(){ return en*boy*y�kseklik; } void degerler(double e,double b,double y) { en=e; boy=b; y�kseklik=y; } } public class uygulama1 {

public static void main(String[] args) { Prizma pr1 = new Prizma(); Prizma pr2 = new Prizma(5,1,2); System.out.println(pr1.hacim()); System.out.println(pr2.hacim()); } } ********************************************************************************** **************

class Ford{ int a; public int b; private int c; } public class uygulama3 { public static void main(String[] args) { Ford f=new Ford(); f.a=5; f.b=8; f.c=10; // b�le yazamay�z ��nk� c private olarak tan�mland� } } ********************************************************************************** ************

Related Documents

8 Ekim Java
November 2019 3
Ekim
June 2020 10
Ekim Gencligi
May 2020 11
Curs-8-java
May 2020 3
29 Ekim 1923 - 2006
November 2019 11
Java Java
June 2020 44

More Documents from ""

Brief.docx
June 2020 2
Enchapes.pptx
December 2019 6
Epidemia De Miedo
April 2020 13
Hoy No
April 2020 14
Luvina News 2
May 2020 15