32,199 Topics
| |
so I need the answer of this qustion : write program in java to creat array from ten integer and count the number of negtive and positive and zero 45,82,-1,35,-4,0,-8,0,9,-11? | |
Hi, I find classes sources on the web that import import org.dyno.visual.swing.layouts.Constraints; import org.dyno.visual.swing.layouts.GroupLayout; import org.dyno.visual.swing.layouts.Leading; But I cannot find this package with google searches. Where is it? Many thanks for your help. | |
Hello! I am a student (obviously, haha), and I am confused about how I need to do something in my driver class. I have a text file that I am reading in, then I decided to use a string tokenizer to parse the data. Now, I need to store the … | |
[code]import java.util.*; import java.util.Scanner; public class exec { public static void main(String[] args) { int num; Scanner inputDevice = new Scanner(System.in); System.out.println("Enter a letter / integer or -1 to quit:"); num= inputDevice.nextInt(); System.out.println("Enter a letter / integer or -1 to quit:"); num= inputDevice.nextInt(); System.out.println("Enter a letter / integer or -1 … | |
HI everyone...i have writing a program in java,but now i ought to write the same progam in uml...do u know if exist andy program that transfer a code from java to uml?thanx ,i am waiting Regards dhija 22 | |
I have done most of the code but am struggling with one bit now, please help The brief is Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, … | |
Hello, I'm currently taking AP Computer Science with no prior experience with programming and I am facing a bit of a problem with the last problem on my programming assignment. You see, what I have to do is write a program that displays a name four times either horizontally or … | |
I'm trying to learn Java Servlets on my own but I'm having some very basic problems. The code [CODE]"import javax.servlet.ServletException;"[/CODE] produces a compiler error, "the import javax.servlet cannot be resolved". I'm using version 3.2.2. Why am I having this problem? | |
I have done most of the code but am struggling a bit now, please help The brief is Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, and … | |
how do i learn java gui? i inkow java commands line but am not familia with gui which software i need to , inkow only eclipse,and jdk | |
hey can u help me by dis problem please write the application to display a window with Code GUI..right Now help me | |
[CODE]public class CashRegister { public CashRegister() { purchase = 0; payment = 0; } public void recordPuchase(double amount) { purchase = purchase + amount; } public void enterPayment(int dollars, int quarters, int dimes, int nickels, int pennies) { payment = dollars + quarters* QUARTER_VALUE + dimes*DIME_VALUE + nickels*NICKEL_VALUE + pennies*PENNY_VALUE; … | |
I am writing a simple program to get user input from Scanner to perform some tasks, I want to get user input only from the number 1 to 3, any negative number or string will display an error message and prompt user to re-enter. Here's comes the problem... When I … | |
I am creating a web-based app written in JSF and Java. One functionality of the system is that the user can select a text file from his pc and import it in order to get the data inside the text file. Do you have any idea on how can I … | |
hi.. uuhhmm.. i have a problem in how to put an String Buffer method here in my code.. uuhhmm.. i just want to know the easiest way of putting a String buffer .. please help . . thanks.. [code="java"]import java.awt.Graphics; import java.util.Random; import javax.swing.*; public class Change { public static … | |
I had to reconstruct my program from the last time I had posted for help. My instructor enlightened me that I needed to follow her example to the tea, even though I had the same output that was required, I did not have all concepts required meet. So, after spending … | |
Ok, so I need some guidance. Am trying to implement a linked list in java. I can't get it. I have been on here - dreaminncode, wikipedia, and some other colleges sites - I still don't/can't get it. I did look at the previous threads on this but they didn't … | |
I have a program that uses two threads, one that adds some numbers and the other takes the sum and finds the average. I used a blocking queue to pass the sum to the other string. I have no problem queue.put() to put the total in the queue and then … | |
i have created an app which reads lines from a .txt file, splits the line at a " " and then stores them in a ArrayList which then gets put in a JTable. i created 27 columns and named them... now i want to add an extra column on the … | |
Hi friends, I am a very new user of this forum and want a simplest program on insertion sort. Can anybody provide me this? | |
I am making hearts, and I cannot seem to add all the cards to the deck. here is my code [CODE] import java.lang.reflect.Array; import java.util.Vector; public class Hearts { String cards[][] = {{"Spade ", "Heart ", "Club ", "Diamond "}, {"A","2","3","4","5","6","7","8","9","10","J","Q","K"}}; Vector <String> deck = new Vector<String> (); String player1[] … | |
Okay so we are doing a BankAccount program in my CS class. One method is supposed to return the information like this - Account Name: <name here> Account Number: <number here> Account Balance: <balance here> The instructions say to return it on multiple lines using the \n command. How do … | |
[CODE] float i = 55 ; float y = 23 ; float u = i / y ; System.out.println(u); [/CODE] i want to print u Round to five decimal places how i can do this approximation ? | |
Can someone dry run and explain me this code? having problem to understand recursion program. [CODE] public class Multiplication { public static void main(String[] args) { System.out.println("Answer:"+Mult(2,3)); } public static int Mult(int x,int y) { if (y==1) return x; else return x + Mult(x,y-1); } }[/CODE] | |
Hi, I know matrix 2d can be written like array[5][5] which saying 5x5 matrix but how do i make the row is like sequence of alphabets so its like array[a...z][5] while the column still numbers. Thanks. | |
I need to build a gui application for Nim. I started writing the code and need help. Will you help me write the Nim game? import javax.swing.JOptionPane; public class Nim { public static void main( String args[] ) { String firstNumber; String secondNumber; int number1; int number2; int sum; firstNumber … | |
[URL="http://www.youtube.com/watch?v=b-Cr0EWwaTk&feature=player_embedded#!"]An Oracle produced song to promote Java; fun stuff[/URL]. ;-) Lyrics at: [url]http://www.adam-bien.com/roller/abien/entry/code_hard_with_java[/url] | |
[CODE]import java.util.Arrays; import java.util.Comparator; public class CameraInventory2 { // The main entry public static void main(String[] args) { // create the array Camera[] camera = new Camera[3]; Cam cam = new Cam(); camera[0] = new Camera(1, "Nokia", 20, 30.0, 8); camera[1] = new Camera(2, "Polaroid", 10, 21.0, 14.1); camera[2] = … | |
hello i'm trying to draw a kind of arrow with an specific thickness. i've already this: [CODE] public void paintComponent(Graphics g){ super.paintIcon(comp, g, width, height); for(int i=0;i<thickness;i++){ Polygon arrow=new Polygon(); arrow.addPoint(7*scale, 0*scale+i); arrow.addPoint(14*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 29*scale-i); arrow.addPoint(4*scale+i, 29*scale-i); arrow.addPoint(4*scale+i, 9*scale-i); arrow.addPoint(0*scale+i, 9*scale-i); g.drawPolygon(arrow); } g.setColor(Color.BLUE); Polygon arrow=new Polygon(); … | |
Hello! Im a java noob and I need to create a program that determines whether the input is an integer or not , can anyone help me out? thanks in advance! btw I have to use [B]Scanner [/B] from [B]java.util.[/B] , I have no idea on how to check if … |
The End.