Shubham Rai

Greenhorn
+ Follow
since Jan 05, 2019
Shubham likes ...
Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
2
Total given
4
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shubham Rai

Junilu Lacar wrote:In all the years I have programmed in Java and used lists, I have never really needed to worry about what the current capacity is. Why do you think it's important to know this?


Nothing important but when you learn something new  a lot of question came to your mind and this question was  of one of them.

Thanks everyone for helping me out!
1 week ago

Shubham Rai wrote:Is there any way to find present capacity of ArrayList?



I am asking a way to check capacity of ArrayList not it's size
1 week ago
Is there any way to find present capacity of ArrayList?
1 week ago
What is the the difference between :
 

when output is same in both cases.
1 week ago
Sir,I agree with you regarding being professional but this website is available on all public network across the world that's why i am posting on this forum and according to WIPO Copyright Treaty the exclusive rights are only applicable in the country or region in which a patent has been filed and granted, in accordance with the law of that country or region and it is not possible for a non US resident to know about US laws.


1 week ago
In short according to  WIPO Copyright Treaty the exclusive rights are only applicable in the country or region in which a patent has been filed and granted, in accordance with the law of that country or region.And also you said i am posting on a US forum but sir i am posting on this forum  because this forum is accessible legally from my country and i am not using proxy for posting.
1 week ago
I have  two TreeSet as h1 and h2 now i want to convert these two TreeSet into HashMap ,h1 as a key and and h2 as a value. So please tell me how can i do this ? Also if i pass (2,3) and(3,2) is it considered duplicate or not?
1 week ago
Most of the code posted by me on this forum is written by me and also my country law supports use of any copyright material which is available publicly for educational purposes.So as long as i am using all these resources for learning ,it is not mandatory to tell the source legally.
1 week ago
Can anyone explain the following code:

when i pass the value of m=60 and n=0 to method Test() ,why it returns 62 not 64?
1 week ago
I write a program to add only even no in ArrayList but the  program gives runtime Exception as :

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at Test.main(Test.java:15)


MyInput : 5
              1 2 3 4 5

Please help me out and tell me what i am doing wrong?
1 week ago
In general way consider a very basic example :


Now coming to your code:
When you pass the value of i++ to your method it will remain as i=0 and after the execution of addTwo() method  it will increase to +1 and hence your line no 7 will print i=1
1 week ago
Can you tell me what is the difference between ++i and i++?
1 week ago
I run this code on my machine it works fine.But since your exception is pointing to line 8 and 23.Check that database name ,username and password must be correct for mysql server and also the spellings of table name as employees and column names as firstname and lastname are correct and exists in your database
Where is your main method? And do you add external jar to your build path?
Well my confusion is that if i can write my own code then what is the need of these tools? What are pro and cons of using these?
1 week ago