aspose file tools
The moose likes Beginning Java and the fly likes inheritance with static print method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "inheritance with static print method" Watch "inheritance with static print method" New topic
Author

inheritance with static print method

vladimir mujakovic
Greenhorn

Joined: Feb 12, 2013
Posts: 18
hello i am writing a person tester application with the following functionality

1. user is prompted to enter name, email address and depending on the selection (customer or employee) social sec number or customer number.
2. the data is printed to the console

the application needs to have an abstract person class with an abstract getdisplayText() method and the person class needs to be extended by a customer class and an employee class which will either append a cusotmer number (if customer) or a social security number (if employee).

additionally the application needs to have a static print method that prints said data to the console.

i have build most of the application but am having trouble printing the data to the console, and not sure what im doing wrong please help! i have hit a wall.

this is my code


James Boswell
Ranch Hand

Joined: Nov 09, 2011
Posts: 657
    
    2

Where in your code are you attempting to call the getDisplayText method for the Person instance?
vladimir mujakovic
Greenhorn

Joined: Feb 12, 2013
Posts: 18
i wasnt sure which method to call, im new to working with inheritance, i tried calling the toString method with no result. when i tried calling the getDisplayText method i kept getting errors so i stopped trying. im not sure how to use the static print method to print out my data. thats the problem im facing
vladimir mujakovic
Greenhorn

Joined: Feb 12, 2013
Posts: 18
i need help please im still stuck
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: inheritance with static print method
 
Similar Threads
using classes
how does the hasNextInt() work in the following situation?
Linked List question
Class and Object Problem
weird hasNextDouble behavior.