Java Bangla Tutorials 85 : Types of Constructor | Video



website : https://www.studywithanis.com
Facebook : https://www.facebook.com/anisul2010s
Facebook page : https://www.facebook.com/studywithanis/
Proudly WWW.PONIREVO.COM

Source

READ ALSO:  How To Bring Your Blog Up To Date

30 Comments

  1. As I'm learing a lot from your tutorial, so,addressing you as my teacher I want to know, "for teacher3 object as there wasn't assigned any value,there output was default value for the individual data type.But without setting value of the variable, as I know there output is always be a garbage value.Then why those variables of teacher3 object output was default value?"

  2. স্যার নাম করা খ্যাত এক প্রাইভেট বিশ্ববিদ্যালয়ে পড়েও কিছু শিখতে পারিনি। আপনার জাভা লেকচার গুলোই একমাত্র ভরসা। ধন্যবাদ স্যার 😌😇💝

  3. নিজের রাতের ঘুম নষ্ট করে আপনি যাদের জন্য ভিডিও বানান তারা আপনার ভিডিও তে কন RESPONDS করে না, হা এটাই বাঙালি। স্যালুট আপনাকে স্যার, কোন স্বার্থ ছাড়া এই ভাবে ভিডিও বানানোর জন্য

  4. package oop_;

    public class Test {

    public static void main(String[] args) {

    Teacher teacher1 = new Teacher("Anisul", "male", 1713545);

    teacher1.displayinformaction();
    Teacher teacher2 = new Teacher("rakib", "male", 154121);

    teacher2.displayinformaction();
    Teacher teacher3 = new Teacher();
    teacher3.displayinformaction();
    }

    }

  5. package oop_;

    public class Teacher {

    String name, gender;
    int phone;

    Teacher(String n, String g, int ph) {

    name = n;
    gender = g;
    phone = ph;
    }

    Teacher() {
    System.out.println("No Value");

    }

    void displayinformaction() {

    System.out.println("Name=" + name);
    System.out.println("Phone=" + phone);
    System.out.println("Gender=" + gender);
    System.out.println();
    }

    }

  6. package oop1;

    public class Teacher {
    String name,gender;
    int phone;
    Teacher(){
    System.out.println("No value");
    }
    Teacher(String n,String m,int ph) {
    name = n;
    gender = m;
    phone = ph;
    }
    void displayInformation(){
    System.out.println("Name : "+name);
    System.out.println("Gender : "+gender);
    System.out.println("Phone : "+phone);
    System.out.println("n");
    }
    }

    package oop1;

    public class Test {
    public static void main(String[] args) {
    Teacher teacher1 = new Teacher("Anisul Islam","Male",1712346898);
    teacher1.displayInformation();

    Teacher teacher2 = new Teacher("Rajib Islam","Male", 171237689);
    teacher2.displayInformation();

    Teacher teacher3 = new Teacher();
    teacher3.displayInformation();
    }
    }

  7. package oop;

    public class Teacher {

    String name, gender;
    int age;

    Teacher() {
    System.out.println("default construction");
    }

    Teacher(String n, String m, int a) {
    name = n;
    gender = m;
    age = a;
    }

    void dispaly() {
    System.out.println("name ; " + name);
    System.out.println("gender : " + gender);
    System.out.println("age : " + age);
    }
    }
    package oop;

    public class test {

    public static void main(String[] args) {
    Teacher teacher1 = new Teacher("Anisul islam", "male", 28);
    teacher1.dispaly();
    Teacher teacher2 = new Teacher("Alamgir", "male", 50);
    teacher2.dispaly();
    Teacher teacher3 = new Teacher();
    }
    }

  8. package objectorientedprogramming;

    public class Teacher {

    String name,gender;
    int phone;

    Teacher(){
    System.out.println("no information found");
    }

    Teacher(String n, String g, int p){
    name = n;
    gender = g;
    phone = p;

    }

    void displayinfo(){
    System.out.println("Name: "+name);
    System.out.println("Gender: "+gender);
    System.out.println("Phone: "+phone);
    System.out.print("n");
    }

    }

    package objectorientedprogramming;

    public class Test {

    public static void main(String[] args){

    Teacher teacher1 = new Teacher("Anisul Islam", "Male", 223344);
    teacher1.displayinfo();

    Teacher teacher2 = new Teacher("Alamgir Hossain", "Male", 678910);
    teacher2.displayinfo();

    Teacher teacher3 = new Teacher();
    teacher3.displayinfo();
    }

    }

  9. package objectorientedprogramming;

    public class ClassObject {

    String name, gender;
    int phone;

    ClassObject(){
    System.out.println("There is nothing");
    }

    ClassObject(String a, String b, int c) {
    name = a;
    gender = b;
    phone = c;

    }

    void information() {
    System.out.println("Name : " + name);
    System.out.println("Gender : " + gender);
    System.out.println("Phone : " + phone);
    }

    }
    package objectorientedprogramming;

    public class Teachers {

    public static void main(String[] args) {
    ClassObject teacher1 = new ClassObject("Anisul Islam", "Male", 46765889);

    teacher1.information();

    System.out.println("nn");

    ClassObject teacher2 = new ClassObject("Alamgir Hossain", "Male", 46764567);

    teacher2.information();

    System.out.println("nn");
    ClassObject teacher3 = new ClassObject();
    teacher3.information();

    }

    }

  10. package oop;

    public class Teacher {
    String name,gender;
    int phn;
    Teacher(){
    System.out.println("No Value");
    }
    Teacher(String n,String g,int p){
    name = n;
    gender = g;
    phn = p;

    }
    void displayInformation(){
    System.out.println("Name = "+name);
    System.out.println("Gender = "+gender);
    System.out.println("Phone = "+phn);
    System.out.println("nn");
    }

    }

    package oop;

    public class Constructor {
    public static void main(String[] args) {
    Teacher teacher1 = new Teacher("Anisul Islam", "Male", 1238750);
    Teacher teacher2 = new Teacher("Rajib sir", "Male", 8765438);

    teacher1.displayInformation();

    teacher2.displayInformation();

    Teacher teacher3 = new Teacher();
    teacher3.displayInformation();

    }

    }

  11. package oop;

    public class Student1 {
    String name;
    int id;
    double cgpa;

    Student1(String n,int i, double c){
    name = n;
    id = i;
    cgpa = c;
    }
    Student1(){
    System.out.println("No Value");
    }
    void display(){
    System.out.println("Name = "+name);
    System.out.println("Id = "+id);
    System.out.println("Cgpa = "+cgpa);

    }

    }

    package oop;

    public class Test1 {
    public static void main(String[] args) {
    Student1 st1= new Student1("Aditi",331530,3.68);
    st1.display();
    System.out.println();

    Student1 st2 = new Student1("Adi",331531,3.54);
    st2.display();
    System.out.println();

    Student1 st3 = new Student1();
    st3.display();
    }

    }

  12. package oop;

    public class Teacher {

    String name,gender;
    int phn;

    Teacher(){
    System.out.println("No Value");
    }

    Teacher(String s1,String s2,int i){
    name=s1;
    gender=s2;
    phn=i;

    }

    void displayInformation(){

    System.out.println("Name : "+name);
    System.out.println("Gender : "+gender);
    System.out.println("Phone Number : "+phn);

    }
    }

    package oop;

    public class Test {

    public static void main(String[] args) {

    Teacher teacher1=new Teacher("Anisul Islam","Male",0171234567);

    teacher1.displayInformation();

    Teacher teacher2=new Teacher("Aminul Islam","Male",0100234567);

    teacher2.displayInformation();

    Teacher teacher3=new Teacher();

    teacher3.displayInformation();
    }

Comments are closed.