32,204 Topics
| |
Create a java that asks the User which laboratory exercise to perform. consider the following specifications: # The program must incorporate all your laboratory exercise you can use cases, and all must be running. # every option in the menu must have t lest a single sentence definition of what … | |
I am writing a program for extra practice from my book on finding the max element in array using Java Generics. My Code so far is: public class GenericMax { public static void main(String[] args) { Integer[] numbers = {1, 2, 3}; //Creates array of integers System.out.println(max(numbers)); String[] words = … | |
How to get min/Max value of a all column in a two-dimensional arra so for example, lets say you have the following 2d array: 1 2 3 4 5 6 7 8 9 Than the out put should be: -- col 1 -- min value at col 1 is 1 … | |
I am using jodatime for datetime. When I persist the date in mysql it stores 2015-09-04 10:30:18 instead of 2015-09-04 14:30:18. My timezone is GMT+4 or UAE. Do you know how to change the timezone? I try to put GMT+4 but it does not work. I run this line on … | |
I have been trying to see what I did wrong in my code, but I counldn't find out. This is my second java program after the "Hello World". Could anyone help me to find out why I did not get the right answer for this. For example, if we enter … | |
hi.i realy need help am a new beginner in java.so i have been trying to do a code in java that returns the largest counter,refering to my libraries.so i was trying to invoke the method comparTo,so i dont know how to use it to compare all counter arrays so that … | |
plz someone give me a code of sudokou solver using backtracking algorithm as console app | |
My code is getting a small error that is refusing to let me entire code compile. Take a look. //THIS IS ASSIGNMENT 4, MAIN METHOD import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; public class Assignment4 { public static void main (String[] args) { // local variables, can be … | |
Hello All. I am having 2 problems here with my code. I will start off with the video code first. The video code should capture 20 seconds of the screen at 50fps, however, when I generate it, it generates a 1 minute 7 second video, and I am not sure … | |
I have a file with ints like this. 1 2 3 4 5 6 How to read first int from file? How to read second int from file? How to skip first line and but rest in 2d array? This is what I have so far. I am not sure … | |
I'm doing a quiz game using netbeans. I've already done the randomization of questions. The problem is, how do i keep a question from repeating itself? ex: chose correct answer --> questionrandomizer comes in --> next question appears but it's the same question earlier here's my code: package kiddiequiz.scienceforms; import … | |
I have to display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan but my output isn't changing. import java.text.DecimalFormat; import javax.swing.JOptionPane; public class MortgagePmt { public static void main(String[] args) { int term; //Term in years … | |
My entity class: @Entity @Table(catalog = "emp", name = "person") @XmlAccessorType(XmlAccessType.FIELD) public class Person implements Serializable { private static final long serialVersionUID = 1L; /** */ @Column(name = "ID", nullable = false,length = 50) @Basic(fetch = FetchType.EAGER) @Id @XmlElement String id; /** */ @Column(name = "ADDRESS", length = 50) @Basic(fetch … | |
hi I am trying to build this game. what i have been trying to build for a long time now. it is a multiplication java game that need random numbers to generate it goes like this difficulty level-easy: this difficulty level easy has 3 rounds. the student must be tested … | |
I have a class where there are a few `static final String` variables that have few values that repesent color values. The class is basically used to get the color values. Is it better to convert this to enum? public class Color{ public static final String GRAY50 = "#808080"; public … | |
hi I am getting this an java.lang.array index out of bound exception: 2 error - I am wondering if this is where am getting it. look it over many times, and I know you all are tired of me but am learning. I like the array but it can be … | |
I have a problem with a project i'm working on, and I was wondering if it was possible to do what i'm thinking. Basically I have a simple mathematical GUI. I want it to take 2 inputs multiply them and output the answer. I am doing this all through the … | |
I have an android application where user will input data about car. When they are done, they will press a button to sync their data. That is, on pressing the button it will call a rest webservice (Jersey) to synchronize the data with the server which will store the data … | |
I'm working on a simple encryption program (for school). It is not currently "homework" just FYI, I'm just practicing the examples in the book. It uses a Caesar's Cipher method (an alphabetical shift). I have not tested this code very much. If something is wrong with it I probably don't … | |
**I'm using netbeans btw if you notice the long code for the GUI** I'm doing a quiz game. The questions are randomized. My problem is, the randomized questions do not appear on the questionLabel (JLabel Variable). I don't know what to do. Help? /* * To change this license header, … | |
Hi there, I wondered if some one would be able to put me through with this, as i am a newbie in Java. I have the following text file named dvdifo: *Donnie Darko/sci-fi/Gyllenhall, Jake Raiders of the Lost Ark/action/Ford, Harrison 2001/sci-fi/?? Caddy Shack/comedy/Murray, Bill Star Wars/Sci-fi/Ford, Harrison Lost in Translation/comedy/Murray, … | |
String contentType = request.getContentType(); if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead, formDataLength); totalBytesRead += byteRead; } String … | |
I need to fix a minor error in my assignment. The prompt is: Assignment #2 will be the construction of a program that reads in an unspecified number of integers from standard input, performs some calculations on the input numbers, and outputs the results of those calculations to standard output. … | |
When I run this I get an error, it's like it's not reading the printf and honestly I have no idea what else to do, can someone help me? import java.util.Scanner; public class MyCarPool2 { public static void main (String [] args){ //Declarations final int WEEK = 5, MONTH = … | |
What is difference between developing website using Java and PHP? | |
hi james/anyone/stultuske I am again trying and practicing my java. I am doing this payroll program which include doing methods and array and have no idea where I have gone wrong again i have debug it but inno me, cant find the error and it is there somewhere anyway here … | |
Hi All, I have a situation where i need to retrieve parentpath from childname in JFace Checkboxtreeviewer. By using below code, i can get both the path seperately. getCheckedElements() - child elements getExpandedTreePaths() - parent elements How i can map childelements with parent? here i get both seperately. When i … | |
Hi All, when i click the save functionality my request is processing and values are stored in database.but the request is coming from chrome browser its not processing and redirected to my error.jsp page.could you please help for this issue. | |
Noob Question. I need some clarifications with using class as a reference datatype or if you have any links that direct to a straightforward explanation,i'd highly appreciate that. (I had been surfing the net for hours, read some books but the explanation is either vague or just an introduction.) |
The End.