Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
65% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
3
Posts with Downvotes
1
Downvoting Members
3
5 Commented Posts
~14.3K People Reached
Favorite Forums

21 Posted Topics

Member Avatar for eny321

Nice job DarkLightning7 but allow me to make a little adjustments to your code: [CODE]public class method { public static void main(String[] args) { elevator one = new elevator(); System.out.println("Current floor is: " + one.getFloor()); System.out.println("Going up two floors.") one.goUp; one.goUp; System.out.println("New floor is: " + one.getFloor); } [U]}[/U] public …

Member Avatar for stultuske
0
4K
Member Avatar for Member #952756

> All I'm doing is removing the last element of the ArrayList, so it should still be an ArrayList, right? No, thats wrong !! remove is a method that returns the element that was removed from the list. Check [this](http://docs.oracle.com/javase/1.4.2/docs/api/java/util/ArrayList.html#remove%28int%29) and in this case it is Integer ! I beleve …

Member Avatar for curiousgeorgem
0
3K
Member Avatar for naief

Hi all I need to put a program on the server that frequently get data from the web and update the database with these data and this program should do this automatically. Can anyone put me on the Beginning of the road. I read in some websites about servlet context …

Member Avatar for naief
0
106
Member Avatar for priyamehta

You should start and we will help you. and about your questions: 1- I don't know how can we import this special file type (csv) and use its facilities but in general you can read the file by using FileInputStream class. 2- I think it is better to creat your …

Member Avatar for priyamehta
0
329
Member Avatar for vin24

Hi ztini. May you explain what is the point of using the static methods. is it only to avoid using the try-catch?

Member Avatar for Member #887084
0
138
Member Avatar for sirlink99

This because of the name clash. Your class name has the same name of a class used in swing package you already use in your program. i.e. Your class name is Timer. In line 10: you define an instance variable "timer" of type Timer. the compiler understands that you want …

Member Avatar for javanoob101
0
894
Member Avatar for zetologos

The benefit of clone method is to make a local copy of the object you created and this method is inherited from Object class. The class inherit this method can also override it so that it can modify it for its own use. this is the reason it returns an …

Member Avatar for naief
0
201
Member Avatar for rohit2

Did you try the method [URL="http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/text/JTextComponent.html#getText%28int,%20int%29"]getText(int offs,int len)[/URL]? I think this method will help if you made some initialization of the JTextPane size and set the offset and length of each start of line. i.e. there is no goto method. but you can creat one using the previous method.

Member Avatar for naief
0
93
Member Avatar for privatestatic

The problem is in the block of code which initialize the grid array. It every time chose the same values for the column and row which are true and it is 0,0 You should first try another formula for chosing the true cells and second you should make sure that …

Member Avatar for JKP()
0
970
Member Avatar for Oddone

Hi Actually I didn't read all the program but I found that you defined the static method sphericalDistance() as zero argument method which do not need an argument to work. [CODE] public static double sphericalDistance()[/CODE] but when you call it in the main method you used an argument System.in with …

Member Avatar for Oddone
0
167
Member Avatar for Dannyo329

Well If you replace the place of this piece of code: [CODE]System.out.println("Do you have a coupon?(Y/N)"); coupon = myScan.findInLine(".").charAt(0); System.out.println(coupon);[/CODE] in the place of this piece of code : [CODE]System.out.println("How old are you?"); age = myScan.nextInt();[/CODE] to let your program be like this : [CODE]public static void main(String[] args) { …

Member Avatar for Dannyo329
0
199
Member Avatar for Member #884252
Member Avatar for Member #884252
0
157
Member Avatar for cretaros

well you can visit [URL="http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JFileChooser.html"]this site[/URL] I think it will be useful. Here is my example which I've borrowed from the same site. [CODE]JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(chooser); if (returnVal == JFileChooser.APPROVE_OPTION) System.out.println("You chose to open this file: " + chooser.getSelectedFile().getName()); if (returnVal == JFileChooser.CANCEL_OPTION) System.out.println("You …

Member Avatar for naief
0
109
Member Avatar for localp

Try creating database and use sql to sort these data. I think this issue related to DBMSs rather than java programing.

Member Avatar for naief
0
94
Member Avatar for eikal

The split method is defined as the following : public String[] split(String regex) regex means regular expression for more infprmation about it [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#sum"]click here[/URL] when you useed the dot "." you used a special character so you need to escape it by "\" back slash but back slash is also …

Member Avatar for naief
0
182
Member Avatar for z00t

you have to define RectangleBox of a Rectangle type or of Rectangle supper classes so either you write [CODE]Rectangle RectangleBox ;[/CODE] in line 10 or you write [CODE]Rectangle RectangleBox = new Rectangle(10, 20, 12, 15);[/CODE] in line 11

Member Avatar for ajst
0
163
Member Avatar for DragoDraco

Hi Where did you get this code? I think this is a home work question. well, First of all Java programmers usually use capital letters in the first letter for the class names so if you see this line you should first see <<Fahrenheit>> which is started with capital letter. …

Member Avatar for masijade
0
129
Member Avatar for Member #884252

In my first look I found that firstN and lastN are of char type ,not in looking in the logic, so try using (==) instead of equals good luck

Member Avatar for Member #884252
0
145
Member Avatar for haribasker

If this exactly what you wrote in the java file then I think you defined actionPerformed method twice : [CODE]public void actionPerformed(ActionEvent ae)[/CODE] This will give you such error Try erasing one of them. I hope this help you.

Member Avatar for naief
0
112
Member Avatar for dfin19

Well, I don't know how exactly get the first array, if you have the code please show me it, but about the second one assuming you got the first one: This is the code [CODE]for (int i = 0; i < 5; i++) { for (int j = 0; j …

Member Avatar for hanvyj
0
2K
Member Avatar for DallasFan3

Here you are the JAVA program int telephoneNumberArrayIndex = 0; char[] telephoneNumberArray = new char[10]; String telephoneNumber; Scanner s = new Scanner(System.in); System.out.print("Please enter a 10-digit telephone number: "); telephoneNumber = s.nextLine(); System.out.println("\nThe following is the number of times each digit appears:"); for (int i = 0; i < telephoneNumber.length(); …

Member Avatar for naief
0
2K

The End.