GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaInterviewQuestionsAndAnswers/docs/constructors.md at master · Nishith1/JavaInterviewQuestionsAndAnswers

Expand file tree

/

constructors.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
29 lines (24 loc) · 506 Bytes
/

constructors.md

Copy path

File metadata and controls

29 lines (24 loc) · 506 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

/com/in28minutes/java/object/constructors/ConstructorExamples.java

package com.in28minutes.java.object.constructors;

class Animal {
	String name;

	public Animal(String name) {
		this.name = name;
		System.out.println("Animal Constructor with name");
	}
}

class Dog extends Animal {
	public Dog(String name) {
		super(name);
	}

	public Dog() {
		super("Default Dog Name");
	}
}

public class ConstructorExamples {
	public static void main(String[] args) {
		Dog dog = new Dog("Terry");
	}
}
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.