Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have to store this value.but eclipse shows error on that.
private final long cal_To_eV = 26131952998320000000L;
plz tell me how to store this.
Have a look at the class BigInteger.
You can use String not long. Also you can use BigInteger or BigDouble.
private final BigInteger cal_To_eV = new BigInteger("26131952998320000000");
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am having a lot of trouble solving this error. Please help. The error is with fxRates.
private HashMap.String.Long.fxRates = newHashMap<String.Long>(40);
You have to use , not .
private HashMap<String,Long> fxRates = new HashMap<String,Long>(40);
Please read some basic java tutorial before proceeding.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a string array
String[] albumnames;
now how to take a string from particular index position with limited number of charachters.
For example,
if, albumnames[position] have value "abcdefghijk"
then i want to take the first 5 characters only.
That is "abcde".
The substring method of String can be used to achieve this. Try
String s = albumnames[position].substring(0,5);
See substring docs
albumnames[position].substring(0,5);
you can see the methods in String class, like substring, indexof
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to translate a chess application that I had made in cpp, to java.
In my cpp version I had a structure which created a tree of strings.
Note, it was not a binary tree.
It was a vector of pointers, so from each node I had multiple subnodes stemming from it.
Does any one know how I could create a similar class in java?
public class ChessObject() {
private String description;
private List<ChessObject> subChessObjects;
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a question about how to write a regex expression to get the key and value pairs from below string?
{"ReturnCode":"0","ErrorMsg":"success","EncryToken":"##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
Could someone help me learn on what this can be done?
Thanks very much.
This one should suit your needs:
"([^"]+)"\s*:\s*"([^"]+)"
The key is in the first group, the value in the second one.
Visualization by Debuggex
You can use Java JSON or the Google Gson to parse this JSON string ...
as illustrated here - http://answers.oreilly.com/topic/257-how-to-parse-json-in-java/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have java String with more than 160 character, on that i want to create substring form that string for first 150 character.
I have google it for that but what i got is for make substring at special character.
Please show me possible way for do this..
String#substring(int beginIndex, int endIndex) is what you need.
String mySubString = myString.substring(0, 150);