Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stucked in this context and useds[]

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is a Keypad's constructor , here PuzzleView is a java file

can anybody help me out in understanding this constructor ?
the value of all three things context, useds and puzzleView

public Keypad(Context context, int useds[], PuzzleView puzzleView) {
super(context);
this.useds = useds;
this.puzzleView = puzzleView;
}
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you get the code from? The KeyPad class PuzzleView class are not standard classes, so we have no context for what they are or how to use them. So if you can point us to documentation (or maybe read the docs for wherever you got the code) then perhaps we can comment.
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PuzzleView.java

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keypad.java

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivam singhal wrote:okey, here is my PuzzleView documentation


No, that is the PuzzleView code. It doesn't tell us anything about KeyPad either.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivam singhal wrote:my Keypad class

Wait, it is your class? So you know what it means because you wrote it, right? So what is your question?
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applogised..
it was a java file..
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
same question..
line 18 - 22
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivam singhal wrote:same question..
line 18 - 22


Same question as what? Those lines of code are the constructor. What problem do you have with it?
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unable to understand how these constructor parameters like useds[] are initialised..

that is what would be the value of the useds, context and puzzleView?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you said this was your class, didn't you? Don't you know what they are supposed to be? Or did you get this code from someplace else and misspoke when you said it was 'your class?'
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I am learning android via learning code from this app..
Yeah i was mis-spoken that its my code,, its not mine, I have copied by just for learning purpose
I am a B.Tech student . so, i didn't find any thing wrong in learning something from someone else code, and off-course i "ll modify this code for my phone's app..
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think copying an entire application and then trying to figure out what it does is very constructive. Even if you 'modify' the code for your own purposes I would be hard pressed to call it your. But more important for learning purposes - it gets too big and you end up trying to learn backwards (why did he do this...) instead of forwards (how do I do that).

I would suggest you start from scratch. Don't start from the code you copied, instead, start from code you write. When you get confused about something specific (how do I draw a line, how do I select a square, etc...) then you refer to the code you copied for ideas. That way, you start from a codebase you understand, learn how to build an application, and still gain the experience from copied code.
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You steve for he awesome advise..
will definately follow what you said because i strongly believe on your thinking..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic