NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package com.company;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Mahkeme m = new Mahkeme("Deneme Mahkemesi");
Davaci da = new Davaci(2);
da.DavaciEkle();
Davali dav = new Davali(1);
dav.DavaliEkle();
Dava d = new Dava("Deneme Mahkemesi", 0001, 07022021,"Sanane Demek",da.Davaci, dav.Davali);
d.getDavalilar();
d.getDavacilar();
d.beyandaBulun();
d.beyandaBulun();
d.kararVer("Galatasaray'ın şike yaptığına ve Fenerbahçenin kazandığına karar verildi. Hakim:Berre :)");
d.zabitGoster();


}
}
class Mahkeme{
//ÖZELLİKLER
private String mahkemead;
public Mahkeme(String mahkemeninadi){
this.mahkemead=mahkemeninadi; //Mahkemenin adını belirliyoruz.

}
}
class Dava extends Mahkeme{ //Dava, Mahkemeden uzayan bir kol olduğu için
//extend kullanarak birbirleriyle ilişkisi oldupunu anlattım
private int davano;
private int davatarih;
private String davakonusu;
private Davaci[] davacilar;
private Davali[] davalilar;
private ArrayList<String> beyandaBulunanlar = new ArrayList<String>();
private ArrayList<String> beyanlar = new ArrayList<String>();
Scanner s = new Scanner(System.in);
private boolean kararVerildiMi=false;
private String mahkemeadi;

public Dava(String mahkemeninadi,int davano,int davatarih,String davakonusu,Davaci[] davaci,Davali[] davali) { //Dava constructoru oluşturduk
super(mahkemeninadi); //mahkemenin hem bu davada adı olabileceği için hem de
//başka bi mahkemede başka dava olabileceği çiçin super kullandım.
this.mahkemeadi = mahkemeninadi;
this.davano=davano; //Atamalar yapıldı.
this.davatarih=davatarih;
this.davakonusu=davakonusu;
this.davacilar=davaci;
this.davalilar=davali;
}

public void beyandaBulun(){
if (!kararVerildiMi){
if(beyanlar.size()%2==0){
System.out.println("Beyan sırası davacı tarafta:");
getDavacilar();
System.out.println("Davacı seçin: 0-"+(davacilar.length-1));
beyandaBulunanlar.add(davacilar[s.nextInt()].isim);
System.out.println("Beyanda bulunun: ");
beyanlar.add(s.nextLine());
}
else{
System.out.println("Beyan sırası davalı tarafta:");
getDavalilar();
System.out.println("Davalı seçin: 0-"+(davalilar.length-1));
beyandaBulunanlar.add(davalilar[s.nextInt()].isim);
System.out.println("Beyanda bulunun: ");
beyanlar.add(s.nextLine());
}
}
else {
System.out.println("Karar verildi. Daha fazla beyanda bulunamazsınız!");
}
}

public void zabitGoster(){
System.out.println(this.mahkemeadi+"n");
System.out.println("Dava No: "+this.davano+"n");
getDavacilar();
getDavalilar();
System.out.println("Dava Konusu:"+this.davakonusu+"n");
System.out.println("BEYANLAR: n");
for (int i = 0; i < beyandaBulunanlar.size(); i++) {
if (i%2==0){
System.out.println("Davacı "+ beyandaBulunanlar.get(i)+":"+ beyanlar.get(i) +"n");
}
else{
System.out.println("Davalı "+ beyandaBulunanlar.get(i)+":"+ beyanlar.get(i) +"n");
}
}
System.out.println("Gereği düşünüldü:n"+beyanlar.get(beyanlar.size()-1));
}

public void kararVer(String karar){
beyanlar.add(karar);
this.kararVerildiMi = true;
}

public void getDavalilar(){
for (Davali d:davalilar) {
System.out.println("Davalı: "+d.isim);
}
}
public void getDavacilar(){
for (Davaci d:davacilar) {
System.out.println("Davacı: "+d.isim);
}
}
public int getDavano(){ //Dava numarasını get metodu ile çağırdık
return davano;
}
public void setDavano(int davanosu){ //Dava numarasını burdan ayarlayabiliyoruz
this.davano=davanosu; //atama yaptık
}


public int getDavaTarih(){ //Bu metod ile dava tarihini çağırabiliyoruz.
return davatarih;
}

public void setDavaTarih(int davatarihi){ //Dava tarihini burdan ayarlayabiliyoruz
this.davatarih=davatarihi; //atama yaptık
}


public String getDavaKonusu(){ //Bu metod ile dava konusunu çağırabiliyoruz.
return davakonusu;
}

public void setDavaKonusu(String davakonusuu){ //Dava konusunu burdan ayarlayabiliyoruz
this.davakonusu=davakonusuu; //atama yaptık
}
}
class Davaci{
Davaci[] Davaci;
String isim;
Scanner s = new Scanner(System.in);
public Davaci(String isim){
this.isim = isim;
}
public Davaci(int davaciSayisi){
Davaci = new Davaci[davaciSayisi];
}
void DavaciEkle(){
for (int i=0; i<Davaci.length;i++){
System.out.println((i+1)+".Davacı'yı giriniz: ");
this.Davaci[i] = new Davaci(s.nextLine());
}
}
}
class Davali{
Davali[] Davali;
String isim;
Scanner s = new Scanner(System.in);
public Davali(String isim){
this.isim = isim;
}
public Davali(int davaliSayisi){
Davali = new Davali[davaliSayisi];
}
void DavaliEkle(){
for (int i=0; i<Davali.length;i++){
System.out.println((i+1)+".Davalı'yı giriniz: ");
this.Davali[i] = new Davali(s.nextLine());
}
}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.