32,204 Topics

Member Avatar for
Member Avatar for NewOrder

i have questions abou the algorithm that i have got here: [CODE] public class BTreeEx3 { public static void main(String[] args) { BTree tree=new BTree(); tree.add(5); tree.add(6); tree.add(1); tree.add(19); tree.add(3); tree.add(10); tree.add(2); tree.print(); } } class BTree{ private Node head; // why is the head private? public void add(int info){ …

Member Avatar for JamesCherrill
0
120
Member Avatar for girlinwayside

I am taking an online java programming class this quarter and the book I have just does not do a good job of explaining anything! The more I read it, the more confused I become! Can someone refer me to an article or site that explains creating methods in terms …

Member Avatar for stultuske
0
2K
Member Avatar for khaled_jawaher

I want to use java to access microsoft sql server express remotely.i have allow remote connection in the database that i have.and i allow port 1433 through firewall. the code is: [CODE] import java.sql.*; import java.lang.*; public class Jdbcconn { public static void main(String[] args) { try { //load the …

0
59
Member Avatar for shivaniaroraji

I was reading a program as follows [CODE]import java.util.StringTokenizer; class Tokentester { public static void main(String[] arguments) { StringTokenizer st1,st2; String quote1="Vdef 3 -1/16"; st1=new StringTokenizer(quote1); System.out.println("Token 1: "+st1.nextToken()); System.out.println("Token 2: "+st1.nextToken()); System.out.println("Token 3: "+st1.nextToken()); String quote2="NGNDFBgh 27/32@3/ewtg@tryh@eretgse"; st2=new StringTokenizer(quote2,"@"); System.out.println("Token 1: "+st2.nextToken()); System.out.println("Token 2: "+st2.nextToken()); System.out.println("Token 3: "+st2.nextToken()); } …

Member Avatar for JamesCherrill
0
146
Member Avatar for raincomeagain

I want to generate random numbers, display them with ten in a row, and count how many are 1s, 2s, 3s, 4s, 5s, and 6s with nested if/else statement. [CODE] import java.util.Random; public static void main(String [] args) { Random generator = new Random( ); int value = 0; int …

Member Avatar for Xufyan
0
140
Member Avatar for Xufyan

In my program I've created two methods , one with integr type and other with float (line # 20 and 29) !! [CODE]class Stack{ int StackArrayI[] = new int[2]; //0,1,2,3,4,5,6,7,8,9 float StackArrayF[] = new float[2]; //0,1,2,3,4,5,6,7,8,9 int tos=-1; public void push(int value){ if (tos==1) System.out.print ("Stack already Full..!\n"); else StackArrayI[++tos] …

Member Avatar for Xufyan
0
112
Member Avatar for nix_xin

Simple Reusable Portable (Platform Independent) Distributed Robust Secure High Performance Dynamic Threaded Interpreted aside from those, what else are the fundamental components of java application programs?

0
55
Member Avatar for slixtrix

[CODE]import java.util.Scanner; import java.io.*; public class infixtopostfix { String fname; String output = ""; public infixtopostfix(){ System.out.println("starting infixtopostfix() method..."); getFileName(); readFileContents(); } public int priority(Object x){ if(x.equals('+') || x.equals('-')){ return 1; }else if(x.equals('*') || x.equals('/')){ return 2; }else{ return 0; } } public void getFileName() { Scanner in = new …

Member Avatar for slixtrix
0
142
Member Avatar for jems5

Since starting this course and seeking to join this forum, I have learned a lot and want to thank everyone for their assistance on my own forum questions as well as those I have read during research in this forum. Having said that I have another array question. I now …

Member Avatar for jems5
0
132
Member Avatar for justme_nick

I need to make a program to illustrate the Random Class and loop sentinels. So far, I can ask for the input of the number. After that, there are countless logical issues that are coming up. Can anyone help me sort this out? [CODE]import java.util.Scanner; import java.util.Random; public class HiLo …

Member Avatar for coil
0
106
Member Avatar for jwmollman

Hello, I'm trying to figure out how to populate an array by using subroutines. We have begun procedures last week, and now this week we are moving onto arrays. College moves too fast sometimes. :( What I'm trying to do is make a subroutine which will populate the entire array …

Member Avatar for NormR1
0
145
Member Avatar for xterradaniel

I need to create a custom panel that displays X,0, or nothing, randomly. It is supposed to be something like a tic tac toe board. The only thing is, when you open it it must randomly place the x's, 0's, or blank spaces, and when the screen is resized by …

Member Avatar for NormR1
0
133
Member Avatar for HDavison4139

what i am trying to do is this Display the mortgage payment amount and then list the loan balance and interest paid for each payment over the term of the loan. If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display …

Member Avatar for NormR1
0
130
Member Avatar for HDavison4139

This is what i have so far.. i've figured out how to do the mortgage payment but I am having trouble displaying the loan balance and interest paid for each payment over the term of the loan. can someone please help with the code and formulas? Here's the code i …

Member Avatar for NormR1
0
568
Member Avatar for plasticfood

[CODE] int [] wronglist = new int [incorrect]; for (int i = 0; i < 6; i++){ for (int j = 0; j < i; j++){ if (studentArray[i] != ansArray[i]) wronglist[i] = (j+1); [/CODE] ok i'm trying to write a program that figures out what number did the user got …

Member Avatar for plasticfood
0
272
Member Avatar for mallak alrooh

hello Friends:; I have question and I wont your help.. I do it,but I'm stuk in printing :icon_cry:.. This the code, I hope you can help ,, Thanks Write a class TelephoneDirectory. It has a telephoneList attribute as a HashMap. The TelephoneDirectory has the following methods: a.addTelephoneEntry ( TelephoneNumber number, …

Member Avatar for JamesCherrill
0
261
Member Avatar for poly712

hi.. we really need help on how to d i s p l a y, a d d, s u b t r a c t, m u l t i p l y polynomials. the display should be in ascending order of degree.. and our program should be j …

Member Avatar for NormR1
0
142
Member Avatar for dreamsky999

Hi Netizens, I wish you guys can guide me in here. In the following code, I've compiled flawlessly and I didn't managed to get the output screen and I'm kind of in the dark since I didn't find the answer that I wanted through internet browsing after a while. Any …

Member Avatar for JamesCherrill
0
246
Member Avatar for Xufyan

in this program i've pushed 10 values into array but i use the condition [iCODE]if (tos==9)[/iCODE] which means no value should be stored at 10th position but when i am storing values, [iCODE]for (int i=1;i<=10;i++) first.push(i);[/iCODE] [CODE]class Stack{ int StackArray[] = new int[10]; int tos; Stack(){ tos=-1; } public void …

Member Avatar for NormR1
0
281
Member Avatar for wadelucy

I got some problem here..I wanted to generate 6 digits number without repeating into a textbox when the form load in java...but i m stuck and lost here...someone can help me ??

Member Avatar for kramerd
0
91
Member Avatar for mihu

Hallo everybody, Can someone help me with some regexs for testing : - in a textbox , i need to test only string carachters , not numbers,digits, spaces; - in a textbox , i want to text only numbers, not strings, char..other. Please.. Pattern patternForInfo = Pattern.compile("[a-zA-Z]", Pattern.CASE_INSENSITIVE); Pattern patternForNumere …

Member Avatar for mihu
0
145
Member Avatar for purijatin

What is the maximum size of one Datagram Packet java makes. Iam implementing my own protocol with defined features which runs over UDP. For every packet i have defined a set of headers. Now these headers are to be defined in every packet. So unless i do not know the …

Member Avatar for NormR1
0
97
Member Avatar for Lxyslckr

[CODE]import java.util.Scanner; import java.text.DecimalFormat; public class Assignment3 { public static void main(String [] args) { Scanner scan = new Scanner(System.in); String first,last ; int id; //First and last names and ID input System.out.println("Welcome to the Grade Calculator"); System.out.print("Please enter your first name:\t"); first = scan.nextLine(); System.out.print("Please enter your last name:\t"); …

Member Avatar for NormR1
0
129
Member Avatar for sky_B

I don't know what is wrong with my code here, the if conditions there never run true.[CODE] String words [] = new String[10];{ //Store the word string words[1] = "apple"; words[2] = "ice cream";} String searchData = ""; JTextField mySearchArea = new JTextField(7); public void init() { setLayout(new FlowLayout(FlowLayout.RIGHT,10,10); add(mySearchArea); …

Member Avatar for sky_B
0
118
Member Avatar for sixdegreesunder

Hi everyone, I m running program but got stuck in after if/else if statements, Jpane doesnt show anything.I couldnt figure out. Thanks [CODE]public class FancyGuessingGame { public static void main(String[] args) { Scanner console = new Scanner(System.in); int guess; int num; String name; String Guess; name = JOptionPane.showInputDialog(null, "Please enter …

Member Avatar for NormR1
0
142
Member Avatar for kkjava

HI All, can any one help me how to convert customize date formats like these below "JAN FY2010" "Q1 FY2010" [CODE]DateFormat df = new SimpleDateFormat("?")[/CODE] as i couldnt find any matching date formats to these. Appreciate your help!!!!!

Member Avatar for NormR1
0
159
Member Avatar for plasticfood

[CODE]public static int totalCorrect(String [] studentArray, String [] ansArray){ int numCorrect = 0; for (int i = 0; i < 6; i++){ if (studentArray[i] == ansArray[i]) numCorrect += 1; } return numCorrect; } [/CODE] instead of returning the actual number, it always return 0. here is the whole program: [CODE]import …

Member Avatar for plasticfood
0
129
Member Avatar for TahoeSands

For several weeks, I have been trying to wrap my brain around the concept of the paint(Graphics g) method. I have a pretty good idea how it works, but I am still struggling with the "practical" application of the paint method with respect to OOP. I can write small apps …

Member Avatar for TahoeSands
0
168
Member Avatar for NewOrder

[CODE] public class InnerEx7 { public static void main(String[] args) { Foo foo=new Foo(); Foo foo2=foo.stam(55); foo2.print(); } } class Foo{ String word="bye"; void print(){} // what does this fucntion do. why do i need it if it is empty public Foo stam(final int x){ final int y=10; class Inner …

Member Avatar for NewOrder
0
112
Member Avatar for NotSneaky

I need help with my sort. it will sort first name but when it gets to last name and DOB it wont. Please help me I tried bubble sort and it didnt work. I would like to use bubble sort. import javax.swing.*; import java.util.Scanner; /** * @(#)program 2.java * * …

Member Avatar for Ezzaral
0
102

The End.