Java basic question


#1

I have an id that is a Long. I want to increment it using a random number. However, I keep getting errors that Im lookong for a java.lang.Long but have a long.

How can I convert the random number long to a Long?

or how can I increment a java.lang.Long using an integer?


#2

Hi Rustic,

Create the random number as an Integer (not int) then you can call .longValue() which will return a long datatype.

Hope this helps.

Martyn


#3

Hi Arun,

I don’t really understand your question. Can you please elaborate further?

The Java 1.4.2 API is available at http://java.sun.com/j2se/1.4.2/docs/api/index.html

If you need further information about the classes etc.

Martyn


#4

Sri,

You’ll find that you can have multiple inheritance by using interfaces.

This is a good article java does not have a multiple inheritance (via two or more extends).

Martyn


#5

how the System.out.pritnln() is defined


#6

why there is no multiple inheritance in java?


#7

It introduces ambiguities and makes the code difficult, and sometimes impossbile to read. But mainly it has proven to be unnecessary.


#8

who when and why java was invented?


#9

Hi manjunath,

http://www.webopedia.com/TERM/J/Java.html
The above website should be able to help with your questions.

Martyn


#10

Hi Prasad,

I had a look at that zip file - more specifcally, the file “java-technical-questionnaire.doc”.

There are just over 300 questions to be answered. Some of them arn’t even Java related, over half of them can be answered by using google.

I am sorry, but I do not have the time to answer all these questions.

Martyn


#11

please answer to this questions as soon as possible
material-v[1].prasad.babu.zip


#12

Hi,

I was wondering how to send a quesry to a search engine via Java and capture the respond? I need to do this task several times a day. Can you please tell me what to use. This stuff is new for me.

Taima


#13

hi friend

inorder to achieve multiple inheritance only we are using the interfaces.

using interface we can acieve multiple inheritance indirectly by using the extends and implements keword.


#14

Hello I need java Quiz ,java questions an objective type ,please sen tas soon as possible
thankyou
G.Prasath


#15

You can convert your long variable into a Long object by instantiating an object of Long.

long id = 9;

Long obj = new Long(id);


#16

what is an interface and why it is?


#17

its simple man,

first u convert the “long to string” by String var=""+.
then using the parseLong() of Long class , u can obtain ur desired result.

bye…


#18

Write a Java application, StringAnalysis1, that reads a string consisting of 0’s and 1’s only, validates its input,
and then reports on the length of the longest sequence of 1’s in the string read and the index of its starting character.


#19

hi,
i want all of the questions .please forward thease as well as others on my mail


#20

In awe of that asnewr! Really cool!