32,199 Topics

Member Avatar for
Member Avatar for caffrea4

Hi, I'm new to java but have some experience with C++ can anyone help me with a basic code to display inheritance? I'v chosen a Parent class Phone and a Child class Mobile and I want to simply use the display method from my parent class on the child class. …

Member Avatar for JamesCherrill
0
95
Member Avatar for JRDJ12

[CODE]package com.abc.text; public class StringProcessing { /** * Returns the number of non-null strings in the set. * If null or a zero-length array is passed in, then zero is returned. * If a slot in the array is null, then it is ignored (not counted). */ public static int …

Member Avatar for JRDJ12
0
466
Member Avatar for HITMANOF44th

im new to java so if im doing some thing the wrong way please let me know this is the class that connects to data base and grabs all the info from colum 1 and colum 2 that part works now when i try to either make it a useable …

Member Avatar for HITMANOF44th
0
170
Member Avatar for swink11123

[CODE] import java.util.ArrayList; import java.util.Scanner; import java.io.*; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Write a description of class Auction here. * * @Bong Suk Ing * @20/10/2011 */ public class Auction { private int displayPrice; private int increase; private int …

Member Avatar for stultuske
0
159
Member Avatar for Ashenvale

Hi guys :D.. just wondering.. when I'm using scanner this is the code I use to ignore the case "to put in the do..while statement" [CODE]} while (choice.trim().equalsIgnoreCase("Y"));[/CODE] I've been looking all over the net. what code should I use if I'm using JOption.. can anybody please help me on …

Member Avatar for thines01
0
201
Member Avatar for BurgerBob

Hi guys, I'm taking a Networking & Internet Systems module... have little experience working with java and am trying to work through an assignment... hopefully you can help! I've been given skeleton code to complete for a program that acts as a simple email client that uses TCP/IP sockets to …

0
86
Member Avatar for nchy13

i am wondering what is the problem here. here text.txt is the input file. any help will be highly appreciated. [CODE]import java.io.*; public class Main{ public static void main(String[] args) throws Exception { File f= new File("text.txt"); BufferedReader in = new BufferedReader( new FileReader(f)); String line = new String(); line …

Member Avatar for NormR1
0
104
Member Avatar for nchy13

i am quite new to java i used to code in c++ but now we have to program in java which has not been taught. i browsed net but casn't get enough information this is my first code which i managed to get from net [B]i am using GNU java …

Member Avatar for nchy13
0
404
Member Avatar for newbie-java

I have the user enter a string e.g. subject of book using a scanner then a for loop, to print out all the books with the same subject to what the user entered. But I'm having a problem in that it will only print out the first occurrence. For example …

Member Avatar for stevanity
0
206
Member Avatar for DrFilth

Hi! I’m have been following the JAAS turrial: [url]http://download.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html[/url]. And the program works fine when I compile it from the command prompt in Windows. But when I try to compile and run it with eclipse it gives the error: Error: Could not find or load main class java. I think …

0
114
Member Avatar for junsugal

This is the only part of my assignment that has problem. Can anyone tell me what's wrong? I debug it, it shows me NullPointerException... please give me a hint, i urgently need this to be done. Its due today. So, I am supposed to write a method captured that will …

Member Avatar for NormR1
0
164
Member Avatar for atramposch

[CODE]public Node<E> remove (int index)[/CODE] i need to recursively implement this method. Node<E> nodes contain two fields, next (a reference to the next node in the linked list) and element (a reference to the data it contains) [CODE]public E element; public Node<E> next;[/CODE] Do not worry about the checking for …

Member Avatar for atramposch
0
2K
Member Avatar for coolsport04

I am trying to write a program that kind of resembles and etch-a-sketch. I have the basis for it. I am having two problems: 1. When I draw a shape in the default black color, when I switch the color it changes the color of what I had previously drawn. …

Member Avatar for Ezzaral
0
211
Member Avatar for dennysimon

Hello all Does Caret Event only for one component only ? I tried to find example for more than one TextField which added with CaretListener,but cannot find one. Anybody know website or has example like I need ? I need to know how to detect which component arise the CaretEvent …

Member Avatar for dennysimon
0
132
Member Avatar for kiaski

A number is called a proper divisor of N if M < N and M divides N. A positive integer is called perfect if it is the sum of its positive proper divisors. For example, the positive proper divisors of 28 are 1, 2, 4, 7, and 14 and 1+2+4+7+14=28. …

Member Avatar for Ezzaral
0
256
Member Avatar for Muna Oman

Hello folk i am a new member n i need Ur help to do my course project for developing Sudoku game i already have my codes but i need a code for generating random numbers in the grid this is basically my code [code]import javax.swing.*; import java.awt.*; import java.util.*; /* …

Member Avatar for NormR1
0
653
Member Avatar for skylinepkr

I have an assignment to make a paint program using java but i am kind of stuck at a roadblock. I have a pencil tool and i used the mouseDragged, mousePressed, and mouseReleased methods of mouse(motion)listener to draw my path using general paths (lineTo and moveTo). My question is, is …

Member Avatar for Ezzaral
0
114
Member Avatar for BDan

I am a fairly new programmer still in school, and trying to have my program write the selected information to a designated file. I keep getting an error message on my file OutputStream. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.text.*; class ExampleJComboBoxSample extends JFrame implements …

Member Avatar for Ezzaral
0
167
Member Avatar for maurya10
Member Avatar for JRDJ12

Can someone show me what bubble-sorting an int[] of { 5, 4, 3, 2, 1 } looks like? I have to place it inside [CODE]public class SortIntArray { // this method needs your code to be added to work public static void sort(int[] list) {[/CODE] with no calls to any …

Member Avatar for NormR1
0
260
Member Avatar for nchy13

can somebody help me out by providing link to the stuff related to buffer reader in java to read a trace file and store it in array of string.

Member Avatar for Ezzaral
0
359
Member Avatar for Mojtabarahimi

Hi Actually i try to do this programming but i have some problems. I'll become thank you if help me to fix it. It is a simple Ferry Ticketing System with below conditions : FERRY TICKETING SYSTEM A small ferry company has just purchased a computer for its new automated …

Member Avatar for NormR1
0
2K
Member Avatar for sidd1994

hi people i am new to this site ... i needed a bit of help i have got an home work to create this :the use will enter 6 random numbers and the computer will print the series :input: 10,5,6,4,3,6 output: 10 5 6 4 3 6 5 1 2 …

Member Avatar for sidd1994
0
99
Member Avatar for Catobion

Hello, I am new, and this question may seem stupid but I'm kinda lost.. i didn't attend the first classes because I was ill. Can someone help me to construct a pseudo-code for a rectangle like this: ******** * * * * ******** (it doesnt look right - it should …

Member Avatar for stultuske
0
105
Member Avatar for newbie-java

I have the user enter a string e.g. subject of book using a scanner then a for loop, to print out all the books with the same subject to what the user entered. But I'm having a problem in that it will only print out the first occurrence. For example …

Member Avatar for stultuske
0
242
Member Avatar for Joey_Brown

Hello Lets say I have these two classes; [CODE] public class BFF{ private String name; private String surname; private Object friendships; }[/CODE] [CODE] public class BFFG<T>{ private String name; private String surname; private T friendships; }[/CODE] Is it possible to create a generic method that could create a Set of …

Member Avatar for JamesCherrill
0
99
Member Avatar for swink11123

i'm so frustrated about my coding :( now i cant even get it right :( assignment gonna due this coming week T^T and i really need help i hope you guys can really solve my problem for me T^T so here is what i did so far >< [code] import …

Member Avatar for jwenting
0
211
Member Avatar for anand01

Hi all, When I run use to add second element in the tree set it shows java.lang.ClassCastException: could any one explain me why [CODE] import java.util.TreeSet; public class Venus { public String str; public static void main(String[] args) { Venus a =new Venus(); Venus b= new Venus(); a.str="obj1"; b.str="obj2"; TreeSet<Venus> …

Member Avatar for ~s.o.s~
0
137
Member Avatar for mary786

The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set …

Member Avatar for NormR1
0
201
Member Avatar for greatcornholio

Hi all, im doing a program using java and sql, and im trying to set a textbox with a value stored in a database. thing is: i have a combo with airlines, and each airline has a cost for each seat. so what im trying to do is get this …

Member Avatar for stevanity
0
170

The End.