This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kubilaycicek; | |
public class Main { | |
public static void main(String[] args) { | |
Student student = new Student(); //1. Constructor | |
Student student1 = new Student(128, "Kubilay", "ÇİÇEK");//2.Constructor | |
Student student2 = new Student("Kubilay", "ÇİÇEK");//3.Constructor | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kubilaycicek; | |
public class Student { | |
//parametresiz constructor | |
public Student() { | |
} | |
//parametreli constructor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kubilaycicek; | |
public class Main { | |
public static void main(String[] args) { | |
User user = new User(); | |
user.getUser("Kubilay", "ÇİÇEK", 26); | |
user.getUser("Kubilay", "ÇİÇEK"); | |
//Output : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kubilaycicek; | |
public class User { | |
public void getUser(String name, String surName) { | |
System.out.println("Name " + name + " Surname " + surName); | |
} | |
public void getUser(String name, String surName, int age) { | |
System.out.println("Name : " + name + " Surname : " + surName + " Age : "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kubilaycicek; | |
class Car { | |
public void getColor() { | |
System.out.println("Black -> Car"); | |
} | |
public void move() { | |
System.out.println("Move -> Car"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
public class Main { | |
public static void main(String[] args) { | |
Test test = new Test(); | |
test.varArgs(0); | |
test.varArgs(0,1); | |
test.varArgs(0,1,2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
public class Main { | |
public static void main(String[] args) { | |
Test test = new Test(); | |
test.varArgs(0); | |
test.varArgs(0,1); | |
test.varArgs(0,1,2); |