Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,108 members, 7,811,122 topics. Date: Sunday, 28 April 2024 at 12:38 AM

Please Someone Should Help Me With This Java Code - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please Someone Should Help Me With This Java Code (342 Views)

How To Integrate Java Code To Activate Hotel Card / Java Code Pls Modify This Code Help / Java EE Developer And Spring Developer In Here. (2) (3) (4)

(1) (Reply) (Go Down)

Please Someone Should Help Me With This Java Code by darkstar6971(m): 9:57am On Jan 26, 2023
I have write this code and when I run it I keep getting error pls someone should assist me and point the mistake the code is below

public class TestTeam
{
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins"wink;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "
+team1.getTeamName()+" " +team1.MOTTO);
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "
+team2.getTeamName()+" " +team2.MOTTO);
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "
+team3.getTeamName()+" " +team3.MOTTO);
}
}
Re: Please Someone Should Help Me With This Java Code by jackobi(m): 10:08am On Jan 26, 2023
The error in this code is that there are missing semicolons at the end of each line where a Team object is instantiated.

public class TestTeam
{
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins"wink;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "
+team1.getTeamName()+" " +team1.MOTTO);
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "
+team2.getTeamName()+" " +team2.MOTTO);
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "
+team3.getTeamName()+" " +team3.MOTTO);
}
}
Re: Please Someone Should Help Me With This Java Code by airsaylongcome: 10:31am On Jan 26, 2023
Where's the implementation for the Teams class?

And always learn to enclose code in code tags


public class TestTeam
{
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins" ) ;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards" );
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards" );
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "
+team1.getTeamName()+" " +team1.MOTTO);
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "
+team2.getTeamName()+" " +team2.MOTTO);
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "
+team3.getTeamName()+" " +team3.MOTTO);
}
}



I ask for the implementation of the Team class because the naming of the MOTTO function is noticeably different from the other functions to get the school, sport and team names.

Also it looks like you are performing a classic rookie mistake. The Team class needs to be part of your code either by having it as a class or by including it (I'm using include from C++ don't know what the Java equivalent is)
Re: Please Someone Should Help Me With This Java Code by jackobi(m): 10:51am On Jan 26, 2023
public class TestTeam {
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins"wink;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "+team1.getTeamName()+" "+team1.getMotto());
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "+team2.getTeamName()+" "+team2.getMotto());
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "+team3.getTeamName()+" "+team3.getMotto());
}
}
Re: Please Someone Should Help Me With This Java Code by darkstar6971(m): 11:04am On Jan 26, 2023
jackobi:
public class TestTeam {
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins"wink;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "+team1.getTeamName()+" "+team1.getMotto());
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "+team2.getTeamName()+" "+team2.getMotto());
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "+team3.getTeamName()+" "+team3.getMotto());
}
}
same error boss man
Re: Please Someone Should Help Me With This Java Code by darkstar6971(m): 11:05am On Jan 26, 2023
jackobi:
public class TestTeam {
public static void main(String args[])
{
//instantiate three Team objects with different values
Team team1 = new Team("Roosevelt High", "Girls’ Basketball", "Dolphins"wink;
Team team2 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
Team team3 = new Team("DumbleDor High", "Boys’ Baseball", "Wizards"wink;
//display all the data, including the motto, for each object.
System.out.println(team1.getSchoolName()+" "+team1.getSportName()+" "+team1.getTeamName()+" "+team1.getMotto());
System.out.println(team2.getSchoolName()+" "+team2.getSportName()+" "+team2.getTeamName()+" "+team2.getMotto());
System.out.println(team3.getSchoolName()+" "+team3.getSportName()+" "+team3.getTeamName()+" "+team3.getMotto());
}
}
3 errors boss
Re: Please Someone Should Help Me With This Java Code by WebMind: 12:09pm On Jan 26, 2023
Sounds like the problem is a bait for some user account poster be stalking.
Re: Please Someone Should Help Me With This Java Code by darkstar6971(m): 12:32pm On Jan 26, 2023
WebMind:
Sounds like the problem is a bait for some user account poster be stalking.
how
Re: Please Someone Should Help Me With This Java Code by WebMind: 12:50pm On Jan 26, 2023
darkstar6971:
how
you should be pasting the error or output you are getting and not telling the forum a half problem.
Re: Please Someone Should Help Me With This Java Code by darkstar6971(m): 1:12pm On Jan 26, 2023
WebMind:
you should be pasting the error or output you are getting and not telling the forum a half problem.
ok boss

Re: Please Someone Should Help Me With This Java Code by WebMind: 3:06pm On Jan 26, 2023
darkstar6971:
ok boss
you don appoint me as boss join?
Re: Please Someone Should Help Me With This Java Code by darkstar6971(m): 6:00pm On Jan 26, 2023
WebMind:
you don appoint me as boss join?
assist me now
Re: Please Someone Should Help Me With This Java Code by WebMind: 6:18pm On Jan 26, 2023
darkstar6971:
assist me now
and how did you determine I am in a position to assist? You definitely believe or know more than meets the eye here.
Re: Please Someone Should Help Me With This Java Code by etoluw: 11:38pm On Jan 26, 2023
darkstar6971:
ok boss
from the picture, the error is clearly stated - you did not close the brackets

(1) (Reply)

I Need A Programmer / Web Developer Wanted / Registry Requirement

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 18
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.