Solved

I have to create a class in a java code

Posted on 2014-12-09
3
116 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 11

Accepted Solution

by:
Radek Baranowski earned 500 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 11

Expert Comment

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

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

729 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