What exactly is Java type long long
Solution 1
There is no such type in Java. Are you sure the code you read was written in Java? Maybe it was a JNI routine that was called into?
Solution 2
I do not know a type called "long long".
it isn't also listed here: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
Solution 3
"long long" not supported in java
James McGuigan
I am an autodidact polymath who is intrinsically motivated to solve difficult and complex problems. I have two decades of experience and have been teaching myself computers since the age of five. I have run full-lifecycle projects from business analysis, data science research, development, devops, security, performance optimisation, productionization and documentation. Doing this singlehandedly has required obtaining mastery over multiple tech stacks, and the ability to automate reusable abstractions. I consider bottom-up programming as an extension of linguistics, thus a highly technical form of poetry. I believe in the three great virtues of a programmer: Laziness, Impatience and Hubris
Updated on July 09, 2022Comments
-
James McGuigan almost 2 years
I know in Java that "int" is a 32 bit integer and that "long" is a 64 integer. I also know that in C "long long" is an integer at least as large as "long" (but implementation specific).
However I have recently come across some Java code using "long long" and wanted to know how exactly it was defined?
-
Brian over 7 yearsI know this is old, but I had the same question and it seems, also from a test. Here is the code: int equi(int arr[], int n) { if (n==0) return -1; long long sum = 0; int i; for(i=0;i<n;i++) sum+=(long long) arr[i]; long long sum_left = 0; for(i=0;i<n;i++) { long long sum_right = sum - sum_left - (long long) arr[i]; if (sum_left == sum_right) return i; sum_left += (long long) arr[i]; } return -1; }
-
-
James McGuigan about 12 yearsApologies code was supplied as the answer to a Java programming test, but it appears to have been written in C.
-
SATYA PRAKASH SHARMA about 7 yearsIn java we just use long that support 64 bit width , like as in for c++(long long)