
benim MyStack classım için ""maxSize"" maximum elemanı verecek değişkenim bunu bi constructorun içinde
kullanıcı girmeli aynı zamanda "name " adında bir değişkenim var buda aynı şekilde bir constructor içinde kullanıcı tarafından girilmeli.
ayrıca override fonksiyonu toString() kullanacağız. cıktımız:
[stack1] 4 6 1
[stack2] empty bu şekilde.
MyStack s1 = new MyStack("stack1");
MyStack s2 = new MyStack("stack2");
s1.push(4);
s1.push(6);
s1.push(1);
System.out.println(s1.toString());
System.out.println(s2.toString());
5 tane yapıcıya ihtiyacımız var:
1. default constructor (new Stack())
2. parametresini maxsize alan ve maxsizeyi veren constructor. (new Stack(10))
3. parametresini name alan ve name i veren constructor (new Stack("My Stack"))
4. ikisinide parametre olarak alan ve veren constructor (new Stack("My Stack", 10))
5."copy" constructor (Stack s1=new Stack(); Stack s2=new Stack(s1);)
birde hocamın attığı maili direk atayım belki cevirmemde hata olmuştur Yardımlarınız için şimdiden teşekkürler

MyStack class have by default some fixed size of maximum elements, please allow user of your class to specify in constructor what this maximum size is. Also please add posibility to specify name of the stack in constructor. User can either create object without parameters, can specify only size or name, or both of them.
Please also override function toString(), that this code will print:
[stack1] 4 6 1
[stack2] empty
MyStack s1 = new MyStack("stack1");
MyStack s2 = new MyStack("stack2");
s1.push(4);
s1.push(6);
s1.push(1);
System.out.println(s1.toString());
System.out.println(s2.toString());
You will need in total 5 constractor:
default constructor (new Stack())
1-parameter constructor precising maximum size of the stack (new Stack(10))
1-parameter constructor giving the stack name (new Stack("My Stack"))
2-parameter constructor giving the maximum size and the name of the stack (new Stack("My Stack", 10))
"copy" constructor (Stack s1=new Stack(); Stack s2=new Stack(s1);)