473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

getInt() in java

34
what getInt() do???

buffer.getInt()
Mar 26 '08 #1
14 11561
r035198x
13,262 8TB
what getInt() do???

buffer.getInt()
Post all the relevant code using code tags. Also tell us what you think getInt() does.
Mar 26 '08 #2
pralu
34
i think getInt() returns 4 bytes ....n increment the position by 4 bytes in its buffer
Mar 26 '08 #3
r035198x
13,262 8TB
i think getInt() returns 4 bytes ....n increment the position by 4 bytes in its buffer
What is buffer?
Mar 26 '08 #4
pralu
34
What is buffer?
buffer is a temporary storage place
Mar 26 '08 #5
r035198x
13,262 8TB
buffer is a temporary storage place
So, are you going to post your code or not?
Mar 26 '08 #6
chaarmann
785 Expert 512MB
buffer is a temporary storage place
We know that already. But we need the class name of the object "buffer". So we can see what the method getInt(0) is doing.
For example "buffer" could be an object of class "ResultSet". Then it would return the integer value of the stored table column via JDBC.
Mar 26 '08 #7
pralu
34
So, are you going to post your code or not?

no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
Mar 26 '08 #8
r035198x
13,262 8TB
no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
Without the code, no one can tell what getInt does because the answer depends on which class getInt is in.
Example
Expand|Select|Wrap|Line Numbers
  1. class A {
  2.        public A() {
  3.        }
  4.         public String getInt() {
  5.               return "going around in circles";
  6.        }
  7. }
Now
Expand|Select|Wrap|Line Numbers
  1. A buffer = new A();
  2. System.out.println(buffer.getInt());
As you can see my getInt is very much different from your getInt().
Mar 26 '08 #9
JosAH
11,448 Expert 8TB
no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
Ok, if you're not going to tell us what the type (class) of 'buffer' is any guess is as
good as the other; my guess: toInt() first makes daemons fly out of your nose and
then Meryl Streep will hound you for the rest of your life while you turn purple and
your privvy parts will shrink beyond regular proportions while singing the Out of
Africa title song which makes the bytes in your computer laugh at you which in
turn will make Meryl Streep even angrier.

kind regards,

Jos
Mar 26 '08 #10
pralu
34
Ok, if you're not going to tell us what the type (class) of 'buffer' is any guess is as
good as the other; my guess: toInt() first makes daemons fly out of your nose and
then Meryl Streep will hound you for the rest of your life while you turn purple and
your privvy parts will shrink beyond regular proportions while singing the Out of
Africa title song which makes the bytes in your computer laugh at you which in
turn will make Meryl Streep even angrier.

kind regards,

Jos
nice answer jos..... but its something very critical which i cant....
ok i will give u that portion
Mar 26 '08 #11
sukatoa
539 512MB
no i can't ..... m asking the function of getInt thats it.... what u have to do with the code, sir..........
Where did you get that buffer.getInt()?

From the book? from your friend?from the office? from the internet? Where?

If you don't show the code, they don't show also the answer....

Maybe you are looking in this article,

If that is not,

maybe you are trying to be convinced.... and also trying to derive it to them...
And explains it all for you just like what my instructor are doing....

regards, ;-)
sukatoa
Mar 26 '08 #12
pralu
34
nice answer jos..... but its something very critical which i cant....
ok i will give u that portion



EventLogHeader header;
header.setNextIndex(buffer.getInt());

and in the above code EventLogHeader is the class and in that class they have mentioned it like this:


public int getNextIndex() { return (int)nextIndex; }
public void setNextIndex(int nextIndex) { this.nextIndex = (long)nextIndex & ClientData.MASK_U32; }
Mar 26 '08 #13
r035198x
13,262 8TB
EventLogHeader header;
header.setNextIndex(buffer.getInt());

and in the above code EventLogHeader is the class and in that class they have mentioned it like this:


public int getNextIndex() { return (int)nextIndex; }
public void setNextIndex(int nextIndex) { this.nextIndex = (long)nextIndex & ClientData.MASK_U32; }
That is not the relevant code. Where is buffer declared and initialized?
Mar 26 '08 #14
chaarmann
785 Expert 512MB
my guess: toInt() first makes daemons fly out of your nose and
then Meryl Streep will hound you for the rest of your life while you turn purple and
your privvy parts will shrink beyond regular proportions while singing the Out of
Africa title song which makes the bytes in your computer laugh at you which in
turn will make Meryl Streep even angrier.

kind regards,

Jos
Wow! That's awesome what your getInt() function is doing. Better than going around in circles. Can you send me the source code of this function over? I need to send it to a "friend". He once got very angry that I did a bad thing to him. I asked, what thing, and he said, somebody told him, but he doesn't want to repeat it, I should know by myself what I did. I askd him, who told you, and he said, he doesn't want to tell me the name of his informant, because he has promised him to keep his name secret. So he asked what will I do now? I told him I don't know of anything bad that I did to him, and he got angry and told me a liar, he can see the smirk in my face. I should at least be sorry and admit it.
So I said, whatever bad I have done to you, I feel sorry. That calmed him down, but I never figured out what it was.
Mar 26 '08 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Chirico | last post by:
I found the following interesting and wanted to pass it along Reference (TIP 12): http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download Connect and Select from Java //...
3
by: Hans-Dieter Franz | last post by:
Hello, I have a problem with a Java user-defined stored procedure and the "alter sequence" statement. I use DB2 8.1.2 and had the same problem with 8.1.0, but not with 7.*. I get the following...
13
by: Andrew Bell | last post by:
I'm doing a uni course in the UK and one of my semesters is about programming. This is just going to be compilied and executed with no menu just using command promt (javac classfile.class) I am...
3
by: MBReikowsky | last post by:
Ok this is homework, and I have wrestled with this for quite awhile now. My program is supposed to give an error message if the user enters any invalid entries. The program works great when the user...
12
by: bhanu08 | last post by:
I am get this error java.sql.SQLException: Data source name not found and no default driver specified my code for connection is { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");...
2
by: lunas | last post by:
hi i am trying to update a table selecting a value from another table and ve written the following codes for it.. import java.sql.*; import java.io.*; import java.util.*; public class...
21
madhoriya22
by: madhoriya22 | last post by:
Hi, Here is the query which I am using to get the values from the database:- "SELECT ?, COUNT(*) AS COUNT " + "FROM DEFECT_DETAIL " + "WHERE TARGET_MILESTONE = ? " + "GROUP BY ?"; ...
1
by: swethak | last post by:
hi, when i run a java program for to store data and retrive using mysql datatabse i got the following errors.I think in that one of error is due to set the class path.I placed my...
0
by: tangara | last post by:
Hi, I'm trying my very best to include Java Utilites bean inside my application but it is just not working. Hope the expert here can give me some advice. Thanks. My code for the package is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.