32,204 Topics

Member Avatar for
Member Avatar for erikasibulo

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 …

Member Avatar for JamesCherrill
-2
191
Member Avatar for Cory_1

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 = …

Member Avatar for JamesCherrill
0
6K
Member Avatar for hwoarang69

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 …

Member Avatar for JamesCherrill
0
745
Member Avatar for samantha2015

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 …

Member Avatar for samantha2015
0
277
Member Avatar for Toby14

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 …

Member Avatar for Toby14
0
140
Member Avatar for Vinolia

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 …

Member Avatar for JamesCherrill
0
248
Member Avatar for Ahmed_62
Member Avatar for JamesCherrill
-1
103
Member Avatar for Tanner_1

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 …

Member Avatar for JamesCherrill
0
258
Member Avatar for sirlink99

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 …

Member Avatar for sirlink99
0
1K
Member Avatar for hwoarang69

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 …

Member Avatar for Stefce
0
213
Member Avatar for EarhawkPH

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 …

Member Avatar for Stefce
0
265
Member Avatar for mjayyy

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 …

Member Avatar for mjayyy
0
1K
Member Avatar for samantha2015

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 …

Member Avatar for jwenting
0
675
Member Avatar for divinity02

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 …

Member Avatar for divinity02
0
418
Member Avatar for newcoder310

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 …

Member Avatar for newcoder310
0
227
Member Avatar for divinity02

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 …

Member Avatar for newcoder310
0
271
Member Avatar for Brandon Hatch

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 …

Member Avatar for Brandon Hatch
0
228
Member Avatar for samantha2015

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 …

Member Avatar for stultuske
0
174
Member Avatar for Mysquldata
Member Avatar for Curious Gorge

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 …

Member Avatar for Curious Gorge
0
239
Member Avatar for EarhawkPH

**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, …

Member Avatar for EarhawkPH
0
175
Member Avatar for debee

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, …

Member Avatar for JamesCherrill
0
205
Member Avatar for gahhon

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 …

Member Avatar for gahhon
0
500
Member Avatar for Tanner_1

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. …

Member Avatar for JamesCherrill
0
194
Member Avatar for Tierra

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 = …

Member Avatar for rubberman
0
405
Member Avatar for Mysquldata
Member Avatar for Kelly Burby
0
105
Member Avatar for divinity02

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 …

Member Avatar for divinity02
0
189
Member Avatar for surya55

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 …

0
97
Member Avatar for hari_10

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.

Member Avatar for stultuske
0
111
Member Avatar for gtel

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.)

Member Avatar for JamesCherrill
0
152

The End.