fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Binfo{
  8. double v, dv, rad, drad, r;
  9. Binfo(double v, double dv, double rad, double drad,double r){
  10. this.v=v;
  11. this.dv=dv;
  12. this.rad=rad;
  13. this.drad=drad;
  14. this.r=r;
  15. }
  16. }
  17.  
  18. class Ideone
  19. {
  20. public static void main (String[] args) throws java.lang.Exception
  21. {
  22. ArrayList<Group> GroupList = new ArrayList<Group>();
  23. Binfo Bi = new Binfo((double)2,(double)1,0,(double)0.001,(double)0);
  24. GroupList.add(new GroupTest(Bi,10,10,8));
  25. }
  26. }
  27.  
  28. class Group{
  29. ArrayList<Bullet> BulletList= new ArrayList<Bullet>();
  30. Binfo Bi;
  31.  
  32. }
  33. class GroupTest extends Group{
  34.  
  35. GroupTest(Binfo Bi,double bx,double by,int n){
  36.  
  37. super.Bi = Bi;
  38. Binfo Bitemp;
  39. int i;
  40.  
  41. for(i=0;i<n;i++){
  42. Bullet btemp;
  43. Bi.rad=((6.283184)/n)*i;
  44.  
  45. Bitemp = new Binfo(Bi.v,Bi.dv,Bi.rad,Bi.drad,Bi.r);
  46. btemp = new Bullet(Btemp,bx,by);
  47. this.BulletList.add(btemp);
  48. System.out.println("recently "+i+" "+this.BulletList.get(i).bBi.rad);
  49. }
  50.  
  51. //여기까지 들어가는건 잘 들어가거든요
  52.  
  53. System.out.println("---------------------");
  54. //근데 여길 지나친다음에
  55.  
  56. for(i=0;i<n;i++){
  57. System.out.println("loaded "+i+" "+this.BulletList.get(i).bBi.rad);
  58. }
  59.  
  60. //출력하면 값이 통일되버림. 왜이러는거죠..
  61.  
  62.  
  63. }
  64. }
  65.  
  66. class Bullet{
  67. Binfo bBi;
  68. Binfo bBi_pure;
  69. double x,y;
  70. int count;
  71.  
  72. Bullet(Binfo GBi,double bx,double by){
  73. System.out.println("called "+GBi.rad);
  74. this.bBi=GBi;
  75. this.bBi_pure=GBi;
  76. this.x=bx;
  77. this.y=by;
  78. System.out.println("in "+this.bBi.rad);
  79. }
  80.  
  81. /*public void Action(){
  82. this.x = this.x + this.Bi.v*Math.cos((double)this.Bi.rad);
  83. this.y = this.y + this.Bi.v*Math.sin((double)this.Bi.rad);
  84. this.Bi.rad += this.Bi.drad;
  85. if(this.Bi.rad>6.283184) this.Bi.rad-=6.283184;
  86. }
  87.  
  88. public boolean OutRange(){
  89. if( this.x<0 || this.x>500 || this.y<0 || this.y>800) return true;
  90. else return false;
  91. }
  92.  
  93. public boolean Crash(double px,double py){
  94. //do something;
  95. return true;
  96. }*/
  97.  
  98. }
Compilation error #stdin compilation error #stdout 0.08s 380160KB
stdin
Standard input is empty
compilation info
Main.java:46: error: cannot find symbol
			btemp = new Bullet(Btemp,bx,by);
			                   ^
  symbol:   variable Btemp
  location: class GroupTest
1 error
stdout
Standard output is empty