• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 119
  • Last Modified:

I have to create a class in a java code

I know nothing in java and I have to:

Create a class 'Child' which inherits 'Parent'
Serra David Thomas
Serra David Thomas
  • 2
1 Solution
Radek BaranowskiFull-stack Java DeveloperCommented:
public class Parent {
int Age;
String gender;
public Parent(String gen,int ag){
this.Age = ag;
this.Gender = gen;

public class Child extends Parent {
String birthDate;

public Child(String gen,int ag, String bd){

Open in new window

Pretty much it.

place both classes in separate files named Parent.java and Child.java

anything more specific you need ?
Serra David ThomasAuthor Commented:
It's working.
Thank you
Radek BaranowskiFull-stack Java DeveloperCommented:
np. happy to help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Managed Security Services Webinar - March 15

Selecting the right managed security services platform to grow your business can be a huge undertaking. Join WatchGuard and Frost & Sullivan in an upcoming webinar as we dive into the key elements of selecting a vendor platform and partnership to fuel a successful MSSP business.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now