32,204 Topics
| |
i have a code for counting a ones digit in a random number generated 0-100,000,000 and has to display the count 0-9 and how many times they occur. | |
1. Given the following code: String string = "0"; int x = Integer.parseInt (string); Which of these statements is correct and why? A) The code goes in error because the variable string is not an integer B) The code does not in error because the string "0" converts to the … | |
I am trying to use a hash set to do a Monte Carlo analysis of the Birthday Paradox. Here is my pseudo code: Set number of collisions to zero Loop (10 to100 by 10) Loop: Generate a birthday. (use 1-365) See if it is already in the set. If it … | |
The king does not hold absolute power in Spartan Politics as the Ephors, the five elected leaders who have proved to be a hindrance at every step, questioning whether the warriors who were physically unmatchable, were apt in tactics ( taktikés in greek) required in the battle ( máchi̱ in … | |
Hi,i have a text file,how do i parse it in to second file to display only locations names and their average price? CARREG MAKE MODEL COLOUR LOCATIOn PRICE OWNERS MILEAGE 09-L-1258 OPEL ASTRA SILVER LIMERICK 12999 0 35000 01-D-7845 FORD FOCUS BLACK LIMERICK 1500 3 85000 11-D-7425 NISSAN ALMERA WHITE … | |
Following is my code effort.... I want to read first line of file(comma separated) & then create table in JavaDB but stuck here... Please someone help me how to do next???? public class DatabaseDAO { public void FileRead(String st) throws ClassNotFoundException, SQLException, IOException{ String []tokens=null; try{ try (FileReader fr = … | |
Looking for complete code snippets to read through and try to understand. Post them below and I'll post back with what I think it does. | |
Hey everyone, I have the following list in my code public class order { private float amount; public float getAmount() { return this.amount; } } and in main function I have the following list List<List<Order>> ordersList I want to iterate the list through Streams in java 8 in order to … | |
I am able to read 4byte data using byteBuf.getInt() and same way till 8 bytes I am using getLong. I am not able to read 16 byte data. when I googled I understand that java BigDecimal will support 16 byte data. Could any one please help on reading 16 byte … | |
Hi everyone I am new with you. I study in the university, they teaching us many programming languages. I wont you to help me to found the best to focus on. thank you by the way I am good in java ... | |
HI guys, as mentioned in my revious post, I'll redo my wordCount application using the GridBagLayout approach. The functionality of the application hasn't changed at all: I've only removed the various Jpanels and, for simplicity, used only the JFrame and attached all the comonents to the JFrame. I've had a … | |
hi everyone oh gosh imma know allyuh probably get fed up of me. I am building this game, well it is the same game as in my last post. I decided to delete everything and do it over just to figure out my logical error and boi when i really … | |
i had an idea to create an epub editor that I can use on android or on desktop using java. can someone tell me where would be a good place to start? I already have ebooks on learning java. | |
Hi all i need a help to develop[e sequance diagram in Rational Rose or Visual Paradigm ,have use case ready.If this this is the wright place to discuss it,please let me know and i post my use case.I am new to sequance diagrams.Thanks | |
it gives me a arithmeticException on this line System.out.println("\nTotal = " + dSum + " - Average " + (dSum/divider) ); import java.util.*; public class Lab1A{ public static void main(String [] args){ Scanner input = new Scanner (System.in); int [] k = new int [20]; int [] d = new … | |
hi everyone, james, stultuske I am trying to build this multiple choice math game, it is my individual assignment and I have less than a month to finish this and i really need the help as quick and as fast as possible right now the game is not running as … | |
Hi. im doing some exercises and im confused as to what its asking me to do. Problem: write a program that displays the average and highest mark based on the sets of marks entered. values less than 0 and greater than 100 should be ignored input: a list of input … | |
Hi, I am a beginner in Java Programming. I am working on an assignment which includes Circular shift of the words inside a string. I could find a lot of stuff about circular shift of numbers or characters but I have no idea about circular shift of complete words. As … | |
Now that Java cannot be compatible with browsers like Google and FireFox, so many tools working fine before now cannot be launched normally. I used to take Screenr to record my fancy videos and share with friends. And before long it has announced that Screenr will retire and will be … | |
Alright, I am taking a summer course on Operating Systems and it has been a while since I took Java. I am trying to re-learn everything that I have forgotten. In my field, Java was only required as an introduction class and therefore my level of programming in a computer … | |
I try to implement this oauth2 config in my web application https://github.com/ksoumi/SpringSecurityOAuth2. The only difference is that he used an authentication manager with hardcoded username and password. I already have a login with spring security. I have merged only the oauth2 config in my spring-security.xml. I get HTTP status 404 … | |
Hi. Im doing a few exercises because I have a test tomorrow (Wish me luck!). This particular exercise asks for a menu calculator. The Menu is like: 1. Addition 2. Subtraction 3. Multiplication 4. Division 5. Exit Im using do..while and the switch case is in the do..while. and im … | |
Can someone help me figure out why is this not working..... The program supposse to take the data i load into the hashmap from the file and look for the user enters. and suppose to output the answer based on the case. thanks import java.io.File; import java.util.HashMap; import java.util.Scanner; import … | |
Hello, I'm in a beginning Java class, and I am lost :( My homework calls for me to write a program that takes an integer (of unknown length) and prints it one digit per line, like: 5 6 9 8 6 4 3 I have been googling this for hours … | |
hi all this is my individual assignment, it is math multiple choice game program in java. it have to random numbers got the random number but it is supposed to generated two different answer but instead it generated the same numbers for the answer, how do i fixed that. the … | |
I have read few articles on google but I am still confused when to use what. I have come across checked and unchecked exceptions. I have one exception which I need to define. Let say, when xyz is null, I need to throw the inconsistentcyException which I will catch in … | |
HI guys, I'm trying to build a small GUI application where users can input text (in a JTextArea) and by pressing a button, you get a summary of how many times each word in the text has occurred. So here come the questions. First, the GUI itself. The way I … | |
Hello, i faced some problem in building the android calculator. The problems like this: 1) If i click 2 + 3, it worked well, and screen will show the 5.** BUT! **when i clicked + and + and + and +...... it will continuosly add the answer. How can i … | |
I am getting my program to compile but it will not run. It is supposed to take a three digit number, reverse it, then subtract and add the original and reverse number. Why is this not printing out? Code: public class Rev { public static void main(String[] args) { int … | |
i have to write a code that has a random number generated between 1-100 and the user has the choice to keep the number, discard the number and quit the program. and when the user quits the program displays the numbers kept and discarded, but i dont know how to … |
The End.