debugging java vacation program -



debugging java vacation program -

thank viewing post , contributions program. can help me debugging java programme please. found bugs in main method cannot point out bug in other methods.

// vaction 10 days // extendedvacation 30 days public class testclass1 { public static void main(string args[]) { debugvacation myvacation = new debugvacation(int days); debugextendedvacation yourvacation = new debugextendedvacation(int days); system.out.println("my holiday " + myvacation.getdays() + " days"); system.out.println("your holiday " + yourvacation.getdays() + " days"); } } //_____________________________________ class debugextendedvacation extends debugvacation { public debugextendedvacation(int days) { super(days); days = 30; } public int getdays() { super.getdays(); homecoming days; } } //______________________ class debugvacation { public int days = 10; public debugvacation(int days) { this.days = days; } public int getdays() { homecoming days; } }

your debugvacation , debugextendedvacation constructors require int parameter.

you must create objects this:

debugvacation myvacation = new debugvacation(10); debugextendedvacation yourvacation = new debugextendedvacation(10);

this how programme must be:

// vaction 10 days // extendedvacation 30 days public class testclass1 { public static void main(string args[]) { // declaration must done here. int days = 10; // or other value. // pass value of variable parameter here. debugvacation myvacation = new debugvacation(days); debugextendedvacation yourvacation = new debugextendedvacation(days); system.out.println("my holiday " + myvacation.getdays() + " days"); system.out.println("your holiday " + yourvacation.getdays() + " days"); } } //_____________________________________ class debugextendedvacation extends debugvacation { public debugextendedvacation(int days) { super(days); days = 30; } public int getdays() { super.getdays(); homecoming days; } } //______________________ class debugvacation { public int days = 10; public debugvacation(int days) { this.days = days; } public int getdays() { homecoming days; } }

java

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -