Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I have to create a class in a java code

Posted on 2014-12-09
3
Medium Priority
?
118 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Radek Baranowski earned 2000 total points
ID: 40488543
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
ID: 40488555
It's working.
Thank you
0
 
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40488557
np. happy to help
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

618 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