+ 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

15th Jun 2017, 4:52 PM
suryapoojary
suryapoojary - avatar
14 odpowiedzi
+ 5
@suryapoojary what code??????
16th Jun 2017, 2:27 AM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 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)
15th Jun 2017, 5:15 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 2
Thanks ton guys..
16th Jun 2017, 12:13 AM
suryapoojary
suryapoojary - avatar
+ 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; } }
15th Jun 2017, 5:30 PM
Somnath Ghosh
Somnath Ghosh - avatar
+ 1
Your game with all errors fixed. https://code.sololearn.com/cO5U63rP5x7j/?ref=app
15th Jun 2017, 6:14 PM
Milind
Milind - avatar
+ 1
@chirag..in your code..int speed,int tricks..are defined outside the main method???
16th Jun 2017, 12:14 AM
suryapoojary
suryapoojary - avatar
+ 1
thanks @Milind
16th Jun 2017, 3:35 AM
suryapoojary
suryapoojary - avatar
+ 1
@chirag..never mind..thanks though
16th Jun 2017, 3:35 AM
suryapoojary
suryapoojary - avatar
0
there is no error now..but i didn't get what u were trying to do...
15th Jun 2017, 5:10 PM
Somnath Ghosh
Somnath Ghosh - avatar
0
@Somnath ..I'm getting 8 errors
15th Jun 2017, 5:13 PM
suryapoojary
suryapoojary - avatar
0
help me out
15th Jun 2017, 5:17 PM
suryapoojary
suryapoojary - avatar
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
15th Jun 2017, 5:17 PM
Somnath Ghosh
Somnath Ghosh - avatar
0
remove flash player method
15th Jun 2017, 5:26 PM
Somnath Ghosh
Somnath Ghosh - avatar
0
sorry I had forgotten to include the link to the error free code here it is https://code.sololearn.com/cO5U63rP5x7j/?ref=app
16th Jun 2017, 1:36 AM
Milind
Milind - avatar