Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
58% Quality Score
Upvotes Received
4
Posts with Upvotes
3
Upvoting Members
4
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
2
1 Commented Post
0 Endorsements
Ranked #977
~19.8K People Reached
Favorite Tags

58 Posted Topics

Member Avatar for supra

I think it is ur project... u should think abt idea.. and then u should ask abt help in that direction.. if someone will be giving u any idea it means that will be available somewhere on net... otherwise one will patent it :P

Member Avatar for stultuske
1
420
Member Avatar for musikluver4

there is an obvious problem in your code.... u are storing user input in a string ... so it will always take last input. you should store input in a String array of size 2. `String [] testscore = new String[2];` and then 2nd for loop will be like this.. …

Member Avatar for samuel_okos
0
689
Member Avatar for extemer

ur code will not compile .... remove last '+' from your last line ie remove below line --------------------------------------- output="s1 = " +s1+ "\ns2 = " +s2+ "\ns3" +s3+; ------------------------------------------- with output="s1 = " +s1+ "\ns2 = " +s2+ "\ns3" +s3;

Member Avatar for extemer
0
111
Member Avatar for jordanhagen
Member Avatar for gear26926
Member Avatar for bahr_alhalak
Member Avatar for john2342

Comparator interface: this is used to sort objects.. let say you are creating a arraylist and you are adding String or Integer in that arraylist, and after that if you are doinf Collections.sort(list); then it will sort this list in natural order. but assume if you are adding some Employee …

Member Avatar for vchandra
0
106
Member Avatar for the_preface

check what have you done in ur product class constructor. [CODE] public Product (int id, String title, double cost, int total) { id = idNum; name = title; price = cost; quantity = total; }[/CODE] while it shoud be [CODE] public Product (int id, String title, double cost, int total) …

Member Avatar for vchandra
0
351
Member Avatar for mckrm

read scjp, specially collection and threading. not only about functionality but implementation (source code) also [QUOTE=mckrm;1192965]i am new to Java and programming i just joined faculty of computer science and i am doing good but i think that all what i had until now isn't enough for my curiosity what …

Member Avatar for Salem
0
125
Member Avatar for pirateninja1111

can u explain me wat u r trying to do .. [QUOTE=pirateninja1111;1192994]ok so what i am trying to do is create a random int and save it into an arraylist and sum up the contents of the array list. then ask the user if they would like to roll again. …

Member Avatar for pirateninja1111
0
114
Member Avatar for bettybarnes

[CODE] import javax.swing.*; public class RRunner { public static void main(String[] args){ int i; // counter int num; // number to be input int pw=0; // power of sum num = Integer.parseInt(JOptionPane.showInputDialog("Enter a number: ")); for( i=1; i<=num; i++ ){ pw += Math.pow(i, i); } System.out.println("The answer is "+ pw); …

Member Avatar for huyyaya
0
97
Member Avatar for ceyesuma

you can use singleton design pattern [QUOTE=ceyesuma;1192392]I was trying to figure out how to access variable values out of a class. if class x.java hold all the values can class y.java use getClass(??); to get values without making a new class instance(which will erase everything?). then class z.java access it …

Member Avatar for vchandra
0
90
Member Avatar for BuhRock

when you don't define any constructor in ur class then jvm will create a default constructor(with no parameter), but when u are creating any other constructor then default constructor will not be available. so either u create one default constructor as [CODE]public Car(){}[/CODE] or pass parameters in ur existing constructor …

Member Avatar for vchandra
0
125
Member Avatar for c++student01
Member Avatar for vchandra
0
115
Member Avatar for FancyShoes

static methods should be called like this... ClassName.MethodName(params); while your approach is trying to call the constructor. it will be .... className.ItemFound(pistol, "No other items found in Bedroom", "You found Pistol", txt); [QUOTE=FancyShoes;1191084]Hi I am trying to return a boolean value into another method, but it's not working. [CODE] public …

Member Avatar for FancyShoes
0
154
Member Avatar for s2xi

can u elaborate it.. or add rest of the code so that we can compile it and test

Member Avatar for s2xi
0
89
Member Avatar for bigbags911

[QUOTE=BestJewSinceJC;1191119]Use code tags and give better information. What do you mean you "hope that's it"? It is relatively easy to pinpoint a problem to a section of code. Did the code before that point execute properly? Did the code after it ever execute at all?[/QUOTE] yeah correct... code will never …

Member Avatar for jwenting
0
93
Member Avatar for charlieruns

[QUOTE=charlieruns;1190848]So im going to have to have [code]implements Comaparable[/code] and then make a compareTo method or something like the Photo Class?[/QUOTE] yeah implement Comparable interface in ur Photo class and override ur compareTo method.. try to understand this.. [URL="http://www.javapractices.com/topic/TopicAction.do?Id=10"]http://www.javapractices.com/topic/TopicAction.do?Id=10[/URL]

Member Avatar for vchandra
0
180
Member Avatar for Hitman908

it is perfectly fine.. only thing is naming convention is not correct. setname should be changed to setName, setcost should be changed to setCost .............. otherwise everything else is fine

Member Avatar for mckrm
0
307
Member Avatar for lion hunta

[QUOTE=lion hunta;1189313]I need help fixing my telephone keypad application, it will compile but when I run it, it doesnt work someone please help[/QUOTE] it throws ArrayIndexOutofBound exception.. reason is that your Button array size is 12 -------------------------------- keys = new Button[12]; ---------------------------------- while you are trying to add element at …

Member Avatar for lion hunta
-1
168
Member Avatar for JavaGyrl

we don't call constructor like this,,, change ur main method.. [CODE] public static void main(String[] args){ Image image = new Image(3,4); Color color = image.getPixel(0,0); System.out.println("This is the color at 0,0 "+ color); } [/CODE]

Member Avatar for JavaGyrl
0
198
Member Avatar for macpac
Member Avatar for Imberto

[CODE] import java.io.*; import java.util.*; public class SortStringsFromFile { public static void main(String[] args)throws IOException { // O = Orginal // S = Sorted String[] Ostring = new String[100]; String[] Sstring = new String[100]; int sizeN = ReadFile(Ostring, Sstring); sizeN = sizeN>=100 ? 100:sizeN; String[] Ostring1 = new String[sizeN]; String[] …

Member Avatar for vchandra
0
126
Member Avatar for xsach

you can create an Arraylist, and whenver isDirectory is true. add it in ur arraylist.. pass that list as a parameter in other call.

Member Avatar for masijade
0
119
Member Avatar for blazinhieu

Arrays.binarySearch(array,char) gives the index try this [CODE]if (Character.isUpperCase(num)){ System.out.println(num+" is Upper case"); System.out.println("Index is = "+(Arrays.binarySearch(upper, num)+1)); } else{ System.out.println(num+" is Lower case"); System.out.println("Index is = "+(Arrays.binarySearch(lower, num)+1)); }[/CODE]

Member Avatar for mckrm
0
122
Member Avatar for miguelms19

[CODE]public boolean isAllValidDigits() { boolean returnFlag = true; for(int i = 0; i < authorId.length; i++){ if((authorId[i] < 0)||(authorId[i] > 9)){ // as soon as any number not in the range change the flag and break; returnFlag=false; break; } } /// no need to chk if flag is false if(returnFlag) …

Member Avatar for vchandra
0
91
Member Avatar for sinister747

[QUOTE=sinister747;1187337]Thanks for the help, but if you don't mind how exactly can i do a greater or less with Strings? i would presume alphabetically but is that really veasible?[/QUOTE] inside compareTO you should use compareTo again which will return 1/0/-1, you shouldnt do < but compareTo ... for example. [CODE]public …

Member Avatar for sinister747
0
106
Member Avatar for neti1987

[QUOTE=neti1987;1187613]Hi! I try to create HashSet of the next object: [CODE] import java.nio.file.Path; public class WatchedPath { public Path dir; public boolean recursive; public Filter filter; // Ctor with only Path - for comparing between the object (comparing is only by the path!) public WatchedPath(Path dir) { this.dir = dir; …

Member Avatar for neti1987
0
2K
Member Avatar for Alianncox
Member Avatar for Alianncox
0
80
Member Avatar for Colin454

[QUOTE=Colin454;1187253]Hello, apon summing the rows of a two-dimensional array how can you put the results into a new 2D array so that the results can be sorted from largest to smallest or vice versa? we started with a 7 column 8 row array and now want a two column 8 …

Member Avatar for vchandra
0
85
Member Avatar for luvthug

[QUOTE=moutanna;1182516]the error is here: this.aDiameter[i] = aDiameter + 2; it is not permited to assign an array to an integer value.[/QUOTE] No man this will not be a problem... you are adding integer in ur array , which is perfectly correct. Original post doesnt contain full code and it is …

Member Avatar for drohnwerks
0
589
Member Avatar for yacin87

[QUOTE=yacin87;1185468]hello to everybody I have a linked list that contains objects each object contains two String field I want to know how to check if the object that i want insert is already exists in the linked list thank you[/QUOTE] List<String[]> list = new LinkedList<String[]>(); you should check int n …

Member Avatar for vchandra
0
85
Member Avatar for laveena

it will throw an exception whereever you dont have any extension for a file... so when you are checking indexOf("."), thr you put and if/else clause if(index>0) { }else{ }

Member Avatar for laveena
0
166
Member Avatar for jtodd

change below line ---------------------------------------------- System.out.printf( "the answer is %d ", z ); ----------------------------------------------- to ------------------------------------------- System.out.printf( "the answer is %f ", z ); --------------------------------------------

Member Avatar for vchandra
0
105
Member Avatar for aomran

lot of mistakes are thr... when you are trying to remove it 1. on the very first iteration your this line is throwing nullpointer ----------------------- if( top.getKey() <= heapArray[smallerChild].getKey() ) break; ------------------------------- because top == null now when I handle null pointer here and change code to ----------------------------------------- if(top!=null) if( …

Member Avatar for aomran
0
146
Member Avatar for lumbeelock

if you are using compareTo for two objects then that object should implement comparable interface. and compareTo will be used to compare two objects while you are using only one. it will be object1.compareTo(object2) For example. String implements comparable interface. String test = "hi"; String test1 = "HI"; System.out.println(test.compareTo(test1)); cheers …

Member Avatar for vchandra
0
101
Member Avatar for lumbeelock

public Staff(String name,String address,String phone,String email, String title){ super(name,address,phone,email,title); this.title=title; } chk above code... constructor doesnt exists in Employee class. you should have 6 arguments while you are passing 5

Member Avatar for moutanna
0
286
Member Avatar for bravo659

where is the confusion, 2nd and 3rd constructors will work like 1st one only. Whatever arguments you are passing in constructors that you can set to length/width/height. for ex for the second constructor: public Box(int l, int w) { length = l; width =w; height=0; } and setters and getters …

Member Avatar for vchandra
0
175
Member Avatar for picabodaddy

method signature is fine ... but method is wrong.. you are calculation cylinder volume instead of area. cylinder area will be 2*pi*r*r +2*pi*r*h

Member Avatar for vchandra
0
3K
Member Avatar for c++student01

jokeList.get is giving this problem... you arraylist is not populated and when you are trying to get it from selected index it is throwing this exception

Member Avatar for vchandra
0
142
Member Avatar for kesh1000

ahh ... small mistake ............. you can compare strings with "==", you should use .equals replace line number 51 (if (choice == "1")) with if (choice.equals("1")) I am assuming that you know the difference between "==" and .equals. if no then below is the diff: == compares the reference while …

Member Avatar for kesh1000
0
132
Member Avatar for harika.jo

follow these steps: 1. let say you need to findout all the primes till number n 2. create a outer for loop which will iterate from 1 to n (let say int i) 3. create a inner for loop(int j) and chk i%j 4. for prime numbers i%j will be …

Member Avatar for stultuske
0
98
Member Avatar for rowdyboudy
Member Avatar for jtodd
Member Avatar for David22

1. Create a Arraylist for returning the result(out side the while loop) 2. Create comma separated string of all the columns outside the while loop; 3. Inside while loop split this string with "," and you will get string array. 4. iterate this string array and get value (rs.getString) for …

Member Avatar for vchandra
0
118
Member Avatar for benasour

Code is perfectly fine. int...ints is a varargs parameter and it is a java5 addon. with varargs you can send multiple parameters and it will always be the last parameter in method signature. [url]http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html[/url]

Member Avatar for BestJewSinceJC
0
87
Member Avatar for bigbags911

can u write the complete code so that it will be easy to find out what exactly you are trying to do

Member Avatar for bigbags911
0
118
Member Avatar for bigbags911

Try to rewrite it again and then come with confusion. I tried to copy the same code and got so many errors and started fixing it but after sometime I found that it doesnt contain few but tons of errors. code as lot of errors, braces are not closed properly, …

Member Avatar for vchandra
0
92
Member Avatar for paradiseis

is it a code... Dont mind but first try to read the basics then start asking the questions. Read about object, method and variables

Member Avatar for kvass
1
96
Member Avatar for javarook

Assign smallestindex to j and print smallestindex instead of currentValue is this code written by you, reason of this question is that if someone is able to write this much of code then how come he is missing one simple line...

Member Avatar for kvass
0
3K

The End.