32,199 Topics
| |
| |
[CODE]import java.io.*; public class inout{ public static void main (String[] args){ int a; BufferedReader num= new BufferedReader(new InputStreamReader(System.in)); try {System.out.println("Enter a number: "); a = integer.parseInt(num.readLine()); System.out.println("THE NUMBER IS" + a); } catch(IOException e) {System.out.println("ERROR"); {}}[/CODE] [CODE]import javax.swing.*; public class jopt{ public static void main(String[]args){ int x; x = Integer.parseInt(JOptionPane.showInputDialog("enter … | |
hello can you help me what method to be use in searching integers in string for example if the user will input this string having integers. "jemz 123" how can i add the existing integers and what method to be use...please help me...hoping for your positive responds... | |
[CODE=java] public int decrypt(int num) { int number = num; // Encrypted: 4523 Original: 5678 int d0,d1,d2,d3; d0 = number%10; // 3 d1 = number%100/10; // 2 d2 = number%1000/100; // 5 d3 = number%10000/1000; // 4 d0 = (d0 < 3) ? d0 % 10 - 7 : d0 … | |
I am checking on ways to update my text file existing record. For example I wanted to update the "Address" & "SSN" for Mary Rose to other information using the following code fragment. How can I make use of scanner to complete my code? Code Fragment [CODE] case 1: System.out.print("Address: … | |
In line 32 which is the lttr[ctr] = read.next().charAt(0); wont read all the letters that i input. it only reads the last letter that i entered. what should i do to be able to display all the letters i entered and be able to reverse there order so that they … | |
Write a program to convert the month and days into number of the days for year 2010. Example: Input Month and days: May 16 import java.util.Scanner; public class A129323{ public static void main(String [] args){ int i = 0, numberOfDays = 0, sum = 0, previousMonth = 0, count = … | |
So I know that the standard file filter code goes something like this: [CODE]FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG & GIF Images", "jpg", "gif"); [/CODE] That example obviously applies for pictures, and the extensions it searches for are .JPG and .GIF. What if the user, however, has files with no extension? … | |
Hello, I need to print the contents of a Windows Registry folder (Display Names). I have posted what I have started with and would appreciate some help. It returns a null value at this point, even though there are items in this folder. Thank you. [CODE] import java.lang.reflect.Method; import java.util.prefs.Preferences; … | |
Hi there! this an excerpt from an extracted pdb file my team has done in the format of a text file. ATOM 1 N ASN A 2 [B]18.668 27.299 52.379[/B] 1.00 41.19 N ATOM 2 CA ASN A 2 [B]19.400 26.674 53.492[/B] 1.00 40.18 C ATOM 3 C ASN A … | |
[B]Hi wonderful programmers,[/B] [B]I once again need help. First i need to create a class where if the input is a vowel , it returns true and if not it returns false.[/B] [B]i am just learning java, but also just learning classes, methods etc. I know I have to call … | |
I have this great little program that I have made in the JCreator IDE. It has four class files. All of the classes are in a package called org.jfree.panning. They are listed as follows: XYPLOT.class* PanningChartPanel.class PannableXYPLOT.class Pannable.class * = Main Class There are also four .java files corresponding to … | |
Hi ,I have following javva script [code] test.AddQuestion( new Question ("com.scorm.golfsamples.interactions.handicap_1", "Which formula is used to calculate the 'course handicap'?", QUESTION_TYPE_CHOICE, new Array("Course Handicap = Handicap index + number of holes * number of lost balls in last round", "Course Handicap = Number of years experience / annual equipment spending", … | |
Hello i have questions I want to use java in ACM programmnig challenges please tell me what APIs are useful for this competition? I want to use uva-toolkit(uvatoolkit.com) problems to challenge myself how can i use judge these problems in my local computer? how can i use pc2 to judge … | |
New to Java. I am trying to display the contents of my ArrayList. In the ArrayList are objects based off the Class PalletLocations. If I loop through the ArrayList I just get the object name/location (not sure what it is). For example "wms.PalletLocations@30fc1f". [CODE]ArrayList<PalletLocations> palletLocList = new ArrayList<PalletLocations>(); PalletLocations palLoc … | |
I am trying to write a code that reads an integer and then diplays a diamond with the corresponding number of lines. The program I have written displays a solid diamond, but I am only trying to display the outline. Here is my code: [CODE]import javax.swing.JOptionPane; /** *Odd and even, … | |
I have this program I have to write that calculates the volume of a pool and then displays the results along with how much water is needed to fill the pool and the cost to fill the pool if the cost is .77 cents per cubic foot plus a one … | |
Hi everyone, first time here! Well I was interested in programming and thought that I might start programming first with Java. I am a complete newbie at Programming and so I thought that starting with Java will be good. What do you guys think about Java? Also I was wondering … | |
My assignment is to Write an application that reads a non-negative integer and prints the factorial of the integer using the for loop. I am hopelessly lost and don't even know where to begin with this. Does anyone have any advise to get me started? Thank you | |
[CODE]import java.io.*; public class ftp { public ftp() { URL url = new URL("ftp://username:password@ftp.whatever.com/file.zip;type=i"); URLConnection con = url.openConnection(); BufferedInputStream in = new BufferedInputStream(con.getInputStream()); FileOutputStream out = new FileOutputStream("C:\\file.zip"); int i = 0; byte[] bytesIn = new byte[1024]; while ((i = in.read(bytesIn)) >= 0) { out.write(bytesIn, 0, i); } out.close(); in.close(); … | |
Hello, I am doing a homework assignment and I am getting an "illegal character" error and I don't understand. The assignment is to use an array to calculate three mortgage payments based on three differnt rates and terms in years. Thanks in advance Y'all. [CODE] /* calculator program to fully … | |
hello... i am a graduating student now and me and my partner is currently developing our thesis entitled "high tech coin saver". This device is just like a digital coin saver. It automatically counts every coin whenever the user put one, it is limited on counting coins, and it can … | |
Im a it student,I like to learn about java ee concepts and also want to get information it. | |
Hi all, Im currently working on a FTP program that downloads all files in a directory. Currently, I am able to list all the files in that directory, but I am stuck as on how to download all of them automatically. Would need some help in this. Thank you. [CODE]import … | |
Hi daniweb team, Can any one know how to access Memcache value in java.? very urgent ! Thank you, With Regards, Prem | |
Hello guys, I am on the process of doing a java code which should read the excel file to get the values from the excel sheet to use them in my selenium test cases. I have problem in iterating through each row to check them in my test cases sequentially. … | |
Hi: For the longest time, I have been using the IDE "JCreator". I made previous games on it in the past for school, and when it would come to me implementing a background image in my game, I would make a background class, and have the image in my project's … | |
I'm doing an individual final year project using IBM Aglet, JRun and J2ME. The topic is "Mobile agent shopping system", better with some theories. I have no idea about what types of application should be done. Initially, I intended to build a system for the customers to search for the … | |
hi sir, i am gajendran doing engineering in kcg college of Technology in chennai.i planned to do project on j2ee for hospitals management.so i need some idea on hospitals management services. |
The End.