• Post Reply Bookmark Topic Watch Topic
  • New Topic

function Numeric_data  RSS feed

 
wafa khan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning freinds
i hope you are fine
so i do a code that it take the numeric integer from chains

so the objectif that i want do this code in function because i want use this code in different classes java so i want do this code in function this is the code and i hope you help me to show me how can i write this code int function and how can i use this function in other classes



thank you
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wafa khan wrote:so the objectif that i want do this code in function because i want use this code in different classes java so i want do this code in function this is the code and i hope you help me to show me how can i write this code int function and how can i use this function in other classes.

Well, the simplest way to do that is to stick it in a public utility class. A good example is the Math class (java.lang.Math).

However, your code is missing a lot of stuff. What, for example, is numData?

I think it would be much better to describe to us what you want this method to do, not how you want to do it.

Winston
 
wafa khan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i will show you the function that contains all of code:
 
Ashish Dutt
Ranch Hand
Posts: 172
Java MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wafa khan wrote:ok i will show you the function that contains all of code:


Actually your terminologies are incorrect. Its not a function but a <b><u>Class</u></b>
I would strongly advise you to read about the Java API terms for you really need them. with whatever little i could understand from your original post it occurs to me that you want to wrap or write this code
as a function.
Well if that is so then i would advise you to read about creating methods like return type's and non-return types. You can refer to Defining Methods or Generic Methods
Hope this helps.
Cheers.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wafa khan wrote:ok i will show you the function that contains all of code:...

You misunderstand. There's too much code already.

What we need is for you to explain, in English, what you want this function to do. It appears to be manipulating filenames in some way; but exactly what you want is still a mystery.

Winston
 
wafa khan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you i know it's like a mistrey but what can i do i study networking and systems but i have a project about telnet and commands unix with java
so i must do my best to achieve this
i will search and i hope find how can i write this code in function
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wafa khan wrote:thank you i know it's like a mistrey but what can i do


You can answer the question about what you're trying to accomplish. Once again, in English, without regard to Java, what is the purpose of this function?

 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to elaborate, you seem to be saying "How do I use a hammer do do what I need?", but nobody here knows if what you need is to drive a nail, turn a screw, or saw a board in half. It may be the correct answer is "you shouldn't".

Until we know what you are really trying to do, we can't really give you good advice.

So, pretend you are talking to a child. What do you want your code to accomplish?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!