Click here to Skip to main content
15,888,968 members
Home / Discussions / Java
   

Java

 
AnswerRe: adding multiply and division method Pin
Richard MacCutchan23-Feb-15 21:50
mveRichard MacCutchan23-Feb-15 21:50 
GeneralRe: adding multiply and division method Pin
Member 1147410126-Feb-15 14:05
Member 1147410126-Feb-15 14:05 
GeneralRe: adding multiply and division method Pin
Richard MacCutchan26-Feb-15 21:09
mveRichard MacCutchan26-Feb-15 21:09 
AnswerRe: adding multiply and division method Pin
Akash gods27-Feb-15 9:44
professionalAkash gods27-Feb-15 9:44 
SuggestionRe: adding multiply and division method Pin
Richard MacCutchan27-Feb-15 22:23
mveRichard MacCutchan27-Feb-15 22:23 
GeneralRe: adding multiply and division method Pin
Akash gods28-Feb-15 6:48
professionalAkash gods28-Feb-15 6:48 
GeneralRe: adding multiply and division method Pin
Richard MacCutchan28-Feb-15 6:55
mveRichard MacCutchan28-Feb-15 6:55 
QuestionWhat type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan22-Feb-15 7:06
professionalAfzaal Ahmad Zeeshan22-Feb-15 7:06 
Today I was testing the ArrayList of the Java because I've just started learning the Java after C#. Concept that underlies is the generic, similar to the C#, API is somewhat similar.

But there was a problem, that I faced, I started with the String class objects in the ArrayList and I found surprising that the list allows all type of objects in it. For example the following code from my HelloWorld application.

Java
List list = new ArrayList<String>();
        
list.add(new JavaHelloCollections());
list.add("String data");
list.add(4345345345.9898996756);
        
for(Object o : list) {
   System.out.println(o);
}


Well, firstly it compiles all fair and doesn't only compile it also prints the result; a little doubty result for the float (or double) type data.

javahellocollections.JavaHelloCollections@529e0c79
String data
4.3453453459899E9


I am using NetBeans and I am really confused of how can this happen. Does JVM perform some .toString() checks there or what? Where actually does this type check or type conversion happens?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

AnswerRe: What type of check is made in an ArrayList generic? Pin
Richard MacCutchan22-Feb-15 7:38
mveRichard MacCutchan22-Feb-15 7:38 
GeneralRe: What type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan22-Feb-15 8:47
professionalAfzaal Ahmad Zeeshan22-Feb-15 8:47 
AnswerRe: What type of check is made in an ArrayList generic? Pin
jschell23-Feb-15 10:21
jschell23-Feb-15 10:21 
GeneralRe: What type of check is made in an ArrayList generic? Pin
Afzaal Ahmad Zeeshan23-Feb-15 20:26
professionalAfzaal Ahmad Zeeshan23-Feb-15 20:26 
GeneralRe: What type of check is made in an ArrayList generic? Pin
jschell26-Feb-15 9:50
jschell26-Feb-15 9:50 
Questionproject Pin
Member 1146518219-Feb-15 10:35
Member 1146518219-Feb-15 10:35 
AnswerRe: project Pin
Richard Andrew x6419-Feb-15 12:25
professionalRichard Andrew x6419-Feb-15 12:25 
AnswerRe: project Pin
Afzaal Ahmad Zeeshan22-Feb-15 6:55
professionalAfzaal Ahmad Zeeshan22-Feb-15 6:55 
Questionwhy calculation(BMI) is not working.... please help me... Pin
Member 1141203417-Feb-15 9:41
Member 1141203417-Feb-15 9:41 
GeneralRe: why calculation(BMI) is not working.... please help me... Pin
harold aptroot17-Feb-15 10:41
harold aptroot17-Feb-15 10:41 
Questionjava Pin
Member 1145378615-Feb-15 5:48
Member 1145378615-Feb-15 5:48 
AnswerRe: java Pin
Richard MacCutchan15-Feb-15 6:11
mveRichard MacCutchan15-Feb-15 6:11 
AnswerRe: java Pin
Richard Andrew x6419-Feb-15 12:26
professionalRichard Andrew x6419-Feb-15 12:26 
Question[SendingMultipartDataPostRequest] Issues with Sending a Post Request with Multi-part form data Pin
B.Sudhir14-Feb-15 12:27
B.Sudhir14-Feb-15 12:27 
Questionwhy java is called as architectural neutral? Pin
Member 1144945112-Feb-15 22:31
Member 1144945112-Feb-15 22:31 
AnswerRe: why java is called as architectural neutral? Pin
Richard MacCutchan12-Feb-15 22:36
mveRichard MacCutchan12-Feb-15 22:36 
Questionjava netbeans Pin
Member 1144139511-Feb-15 3:23
Member 1144139511-Feb-15 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.