32,204 Topics

Member Avatar for
Member Avatar for dhanh90

why the do-while couldnt return the main body when i did once.when I input n<2 and press enter, it stops and turns to error. i dont know why?could i any one told me why and how to change it and is there another code to do this loop( instead do-while).thanks …

Member Avatar for javaAddict
0
171
Member Avatar for xonxon

[code] import java.util.*; public class course { static Scanner sc=new Scanner(System.in); public static void main(String[]args) { String name,students,addStudent; int numberOfStudents; String courseName,getName,getStudents; int getnumberOfStudents; Course course1=new Course("C++"); Course course2=new Course("Java"); course1.addStudent("Peter"); course1.addStudent("Brian"); course1.addStudent("Anne"); course2.addStudent("Peter"); course1.addStudent("Steve"); System.out.println("Num of student in course1:"+course1.getnumberOfStudents()); String[]students=course1.getStudents(); for (int i = 0; i < course1.getNumberOfStudents(); i++) …

Member Avatar for xonxon
0
110
Member Avatar for iamwa

HI ! GUYS WILL YOU PLEASE HELP ME IN SOLVIG A SIMPLE QUESTION RELATING TO JAVA RMI MY QUESTION IS HOW TO START RMI REGISTRY PROGRAMATICALY with out TYPING IN CMD(command prompt ) start rmiregistry ?

Member Avatar for kekkaishi
0
44
Member Avatar for El Duderino

i dont know where to put my getValidString validation when i ask the user if he wants to judge another public class JudgingApp { public static void main(String args[]) { Scanner sc= new Scanner(System.in); DecimalFormat df = new DecimalFormat("0.##");//format decimals to 2 decimal places //These variables hold the max and …

Member Avatar for kekkaishi
0
161
Member Avatar for jammercb

When the program calls the getValidString it won't display "Judge Another? (y/n)" It seems like everything should work I just can't figure it out //see if the user would like to continue choice = getValidString(sc,"Judge Another? (y/n): ", "y" , "n" ); private static String getValidString(Scanner sc, String prompt, String …

Member Avatar for El Duderino
0
126
Member Avatar for klackey19

Hello all, I am writing a program that implements a parser for the grammar. One of the methods I created is a boolean method which returns true or false depending on if a character is an expression. The compiler is saying "this method must return a result of type boolean" …

Member Avatar for klackey19
0
181
Member Avatar for bruceaj

I have no idea how to fix the compile warning. Y:\Development\Java\Mileage\Mileage\src\my\Mileage\MileageUI.java:296: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector dataList.add(doctorData); Appreciate some suggestions. Thanks..

Member Avatar for Mikeyp926
0
83
Member Avatar for klackey19

Hello all, I am writing a program for a class that implements a parser for a given grammar. I have already successfully written it in c++ and now I have to also write it in java. The string to be parsed is a string array in my program and when …

Member Avatar for Mikeyp926
0
153
Member Avatar for shakunni

Hey, so I need to write an algorithm that will do the following and run in O(n): Search linearly through an array of size n and for each element check whether array[i]>array[i-k] for all k=1,2,...n/5. Its easy to do this with two loops but I cant figure out how to …

Member Avatar for eggmatters
0
105
Member Avatar for Fire00f1y

Unfortunately, I couldn't find a suitable thread already so please forgive me if there is one already... but! This was a project due today which I just bit the bullet and left out one part of. Here is my problem: I am building a circular doubly linked list with a …

Member Avatar for ~s.o.s~
0
170
Member Avatar for ahmedshayan

1. Create a class Account that has following instance variables: a. private account number (string) b. private account holder name (string) c. private balance (floating-point) d. private account opening date (string) e. profitRate (final, floating-point): 5% for all accounts Supply a default constructor, a parameterized constructor, and a clone constructor. …

Member Avatar for javaAddict
0
782
Member Avatar for popi
Member Avatar for tipalm

Hello all I am trying to get a JButton to toggle the setVisible on a JPanel label with an image on it. Below is my code. Thx in advance! [CODE] import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class ButtonExample_Extended implements ActionListener { JPanel titlePanel, buttonPanel, dealerPanel, playerPanel; JLabel dealerLabel, playerLabel, …

Member Avatar for quuba
0
163
Member Avatar for Loved

Hi, I am fairly new to java and have been playing around with scanners and while trying to understand this problem I am running into an error "Non-static variable vacation cannot be referenced from a static context" Obviously this isn't quite a completed program, but I am not sure why …

Member Avatar for Loved
2
160
Member Avatar for udayangaS

hi, i,m newbe to hibernate. can any one explains how to do bi- directional associations in hibernate . cheers... udayanga

Member Avatar for udayangaS
0
56
Member Avatar for eggmatters

Hello all, I have used this code throughout this application with no troubles. I am creating a datatable, and the data is a result set returned from a sql query to an oracle 11g database. I'm creating a TableModel class that overrides the AbstractTableModel so I can add fetures to …

Member Avatar for ~s.o.s~
0
876
Member Avatar for anki.gulsvart

Hi. I really need help. I´ve written a program in java that connects to an ftp-server and changes files. as it is now i have a JPanel and i have to press a button and write the name of the file but i want the program to do this automatically …

Member Avatar for eggmatters
0
81
Member Avatar for dhanh90

I'm new to java.I write the code and dont know why its wrong.Someone can point out and modify it for me.thanks alot. Here the code[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package OOP; import java.util.Arrays; import java.util.Scanner; /** …

Member Avatar for sneaker
0
301
Member Avatar for estefania
Member Avatar for Krishna_vs

Hi, Is it possible that, the Iteration of normal bean (not a Form bean) values contained in a vector into a jsp page.? please help me

0
40
Member Avatar for nateuni

Guys.. I am trying to figure out Comparator so I can compare Strings in an object array (the object has other data types as well). I have been hunting around and have come up with this.. but I cant get it to work --> Can anyone point me in the …

Member Avatar for nateuni
0
94
Member Avatar for lithuanian

Hello. I'm currently have a task to make but i can't complete it because of my weak knowledge. I need to draw half of sin parabola with straight lines . Like this [url]http://www.mif.vu.lt/matinf/asm/vs/pask/java_pr/uzd/7.jpg[/url] It gives me a headache because i really don't like JAVA (I think it's not for me) …

Member Avatar for lithuanian
0
142
Member Avatar for Samyx

I want to create a method equals(Object obj) to test if two objects are equal. But I don't even know how to start. Here is my program [code] class LinkedList { ListItem front = null; ListItem rear = null; int numItems = 0; // Current number of items. // Could …

Member Avatar for Jocamps
0
146
Member Avatar for Derice

i am using scanner class, i faced problem when i tried to get a string with space. How can i modify my code to solve the problem. Here is my code: [CODE] import java.util.Scanner; class abc { public void main(String[] args) { Scanner abc = new Scanner(System.in); System.out.print("Name: "); String …

Member Avatar for javaAddict
0
120
Member Avatar for kilermage

I wrote up a CombatHandler class. Here is what the begining: [CODE]public class CombatHandler extends client {[/CODE] But when I compile I get this error: [CODE]Running Compiler -------------------------------------- CombatHandler.java:3: cannot find symbol symbol : constructor client() location: class client public class CombatHandler extends client { ^ Note: stream.java uses or …

Member Avatar for ~s.o.s~
0
117
Member Avatar for chengeto

I am trying to get this program to count the number of characters in a string. By number of characters l mean not punctuation or a space.What is wrong with my code because l don't understand why the program won't work? [CODE]import javax.swing.*; publiemc class ExamPractise { public static void …

Member Avatar for ~s.o.s~
0
165
Member Avatar for ZER09

I need to create a scientific calculator using applet in neat beans 6.1 but i cant do it. if there someone who did it before, can you help me about my problem.its for our project in our school. asking a help.Thanks a lot.

Member Avatar for .11
0
76
Member Avatar for nola_Coder

Hello... This is my last assignment from my Data Structures class. I turned it in and got a good grade, but it still has one problem that I am unable to pinpoint. The assignment is as follows: Create an alphabetical linked list from a .txt file containing various names. (1 …

Member Avatar for nola_Coder
1
163
Member Avatar for bruceaj

I have several classes that I use in almost every one of my projects. [B]What[/B], and [B]How[/B], do I create something so the I can easily access them? I'm use NetBeans for my IDE. Thanks..

Member Avatar for quuba
0
292
Member Avatar for Chad W

This is my now finished code: [CODE]// ********************************************************** // Count.java // // This program reads in strings (phrases) and counts the // number of blank characters and certain other letters // in the phrase and quits upon the user entering the phrase "quit". // Modified by: Chad Watkins // ********************************************************** …

Member Avatar for Grn Xtrm
0
151

The End.