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� } } ********************************************************************************** ************