Solved

I have to create a class in a java code

Posted on 2014-12-09
3
110 Views
Last Modified: 2014-12-09
I know nothing in java and I have to:

Create a class 'Child' which inherits 'Parent'
0
Comment
Question by:Serra David Thomas
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Radek Baranowski earned 500 total points
Comment Utility
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){
super(gen,ag);
this.birthDate=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 ?
0
 

Author Comment

by:Serra David Thomas
Comment Utility
It's working.
Thank you
0
 
LVL 11

Expert Comment

by:Radek Baranowski
Comment Utility
np. happy to help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now