+ 2
I'm getting error in this java code
I'm trying to increase my understanding of OOP in java by building this Paul Pogba game..I'm getting errors ..please help me fix it.. https://code.sololearn.com/c0oNAbjEowH0/?ref=app
14 Respuestas
+ 5
@suryapoojary what code??????
+ 4
there are many errors.....
• you are trying to save 60m in integer
• you are creating object of a function
• you have to make all functions static (not sure)
+ 2
Thanks ton guys..
+ 1
public class Program
{
int pitch = 60;
int power = 45;
public static void main(String[] args) {
Program Pogba = new Program();
Pogba.run();
Pogba.skill();
Pogba.shoot();
}
int speed = 89;
int tricks = 90;
int stamina = 100;
int rivaldefenders = 4;
int shoot = 0;
public static void France_player() {
}
void run(){
System.out.println("Pogba runs ....there is a considerable amount of composure provided by Pogba");
pitch = pitch - 20;
stamina = stamina - 10;
}
void skill(){
System.out.println("Pogba showing his delightful arsenal beats the defenders with brilliant touches");
rivaldefenders = rivaldefenders - 2;
stamina = stamina - 5;
pitch = pitch - 5;
}
void shoot(){
System.out.println("Pogba finds the space to shoot.....Pogba !!!!!!!!!!!!!!!!!!!!!!!! GOAl!!!!!!!!!!!!!!!!! Paul Pogba scores !!!!!!!!?!");
pitch = pitch - 45;
}
}
+ 1
Your game with all errors fixed.
https://code.sololearn.com/cO5U63rP5x7j/?ref=app
+ 1
@chirag..in your code..int speed,int tricks..are defined outside the main method???
+ 1
thanks @Milind
+ 1
@chirag..never mind..thanks though
0
there is no error now..but i didn't get what u were trying to do...
0
@Somnath ..I'm getting 8 errors
0
help me out
0
but i solved..you didn't use } after flash player method i think and pitch 60 only,,not 60 m...change the class name..make program pogba=new Program()...
declare every variable out of method,,make global
0
remove flash player method
0
sorry I had forgotten to include the link to the error free code
here it is
https://code.sololearn.com/cO5U63rP5x7j/?ref=app