32,199 Topics

Member Avatar for
Member Avatar for Tomi1988

Hi! Which way is the more effective? Is there any difference? If I give value to a variable in the class public class A{ int a = 3; } or if I give value to a variable in the constructor of the class public class A{ int a; public A(){a=3;} …

Member Avatar for ObSys
0
88
Member Avatar for deadsolo

Hi, I need help creating or manipulationg my current regex that will grab two numbers from a line, while excluding a specific number. Here is an example of what the line will look like: "In our tests, downloads on port 6881 achieved up to 12059 Kbps while downloads on port …

Member Avatar for deadsolo
0
180
Member Avatar for jamesperkins0

Hi guys, i am writing a GUI program that will take a tutor minutes and earings and create an average earnings. My problem is instead of it using what we type in the fields E.g 200 mins and 50 dollars earnt and displaying the average. It shows the default fields. …

Member Avatar for jamesperkins0
0
231
Member Avatar for Dane2259

I'm trying to do a quickSort with a Doubly LinkedList. I can partition the original list into a lower and upper sublist, but have been unsuccessful going any further. Below is the code for the class DoublyLinkedList. The methods that perform the quick sort are at the bottom (partition, recQuickSort, …

Member Avatar for Taywin
0
727
Member Avatar for subrat_p

I have a textfield, and that only accept integer numbers. If user input charter type value it shows JOptionpane Error Message and when user click on the ok button in optionpane message the textfield clear itself public void nosgetit(DocumentEvent documentEvent){ DocumentEvent.EventType type = documentEvent.getType(); if(type.equals(DocumentEvent.EventType.CHANGE)){ } if(type.equals(DocumentEvent.EventType.INSERT)){ String ns=nos_txt.getText(); char …

Member Avatar for JamesCherrill
0
548
Member Avatar for pooran.c

int [10] array_int=new int [10]; array_int[0]=0; array_int[1]=1; array_int[2]=2; array_int[3]=3; array_int[4]=4; array_int[5]=5; question is: how to print in circular manner starting from the middle(index is 2) that is output : 2 3 4 5 0 1 .

Member Avatar for stultuske
0
364
Member Avatar for aravind326

Hi, I am just trying to do some program on arithmetic expression parsing. So i want to store my operator precedence table in the program somehow. I could use a multidimensional array, but that would be inefficient i guess. Another idea i have is to use a HashTable, where the …

Member Avatar for aravind326
0
451
Member Avatar for ahmedhesham

1. Rational Implement a rational number class: Rational Augment your class with methods for: a) Initialization (Constructor): parameters are numerator and denominator as integers. You must have 3 constructors as follows  No Parameters: 0 / 1  One Parameter (x): x / 1  Two Parameters (x, y): x …

Member Avatar for jalpesh_007
-1
140
Member Avatar for liz.willy
Member Avatar for System Networks

Hi, I have a jar which cannot be accessed by double clicking on it(I don't know why) but can be opened through the terminal. I just have to put java -jar "myJar.jar" And all the fancy things on the consoles appears then your application appears. I'm planning to release my …

Member Avatar for stultuske
0
119
Member Avatar for hwoarang69

so i have a interview on data structures. i am sure they will ask question on 1d arrays. but what can they ask me? 1.give a array find the max and min value. 2.give a array find avg. 3.sum of all value in array 4.... what else can they ask …

Member Avatar for jalpesh_007
0
177
Member Avatar for Syrne

Hi there, I'm new to tree maps and I am trying to write my own version of the pre-defined "remove" function for Tree Maps. I know I need to have two extra functions that find the minimum and maximum values in the map that will be called within the remove …

Member Avatar for ekemaz11
0
250
Member Avatar for london-G

Hello. I have a tablw which holds quite a lot of information, I would like to print the table in landscape. try { boolean complete = Table_Stud.print(JTable.PrintMode.FIT_WIDTH,header,footer); if (complete) { JOptionPane.showMessageDialog(null, "printing...."); } else { JOptionPane.showMessageDialog(null, "Cancelled!"); } } catch (PrinterException pe) { /* Printing failed, report to the user …

Member Avatar for mKorbel
0
779
Member Avatar for jayl935

Howdy. Instead of displaying text for a few seconds using toast, I would like to display it permanently. At first, I thought toast would be better, now I can't figure out how to simply display it. Here is the toast code: public void onClick(View arg0) { gps = new GPSTracker(TrackingActivity.this); …

0
82
Member Avatar for sheushen

I need to sort the display by name in alphabetical order. How do I do that? public class Node { String name; int age; String position; int salary; String num; Node next; Node() { name = null; age = 0; position = null; salary = 0; num = null; next …

Member Avatar for Taywin
0
200
Member Avatar for BLuv

Hi everyone, I am brand new to Java and I like it a lot so far. I am very stuck on an assignment for school that I need help with. We are just learning about method invocation, how to write and call methods in Java. My program should take user …

Member Avatar for Taywin
0
182
Member Avatar for Kathy0410

Is there a way to modify the bubble sort algorithm so that it will stop as soon as it recognizes that the list is sorted?

Member Avatar for JamesCherrill
0
90
Member Avatar for HankReardon
Member Avatar for stultuske
-2
157
Member Avatar for OsaidAz

ok, so I have two classes: Ticket and passenger passenger class has 3 data members, and one the the ticket data members is: `private Passenger psmgr;` what I want to do is to access passenger's data member using the psmgr variable how do I do that?

Member Avatar for OsaidAz
0
234
Member Avatar for IcyFire

Is there a way for me to manipulate the cells of a grid layout? For example lets say i have a grid that has 5 rows and 5 columns. Is it possible for me to manipulate the cell at row 1 column 2 using the layout, sort of like the …

Member Avatar for IcyFire
0
214
Member Avatar for rahul.ch

List<? extends Integer> list = new ArrayList<Integer>(); for (Integer element : list) { System.out.println(element); List<? super Integer> list = new ArrayList<Integer>(); for (Integer element : list) { System.out.println(element); For the first three lines as Case 1 using extends it compiles fine. But for Case 2 of next three lines, it …

Member Avatar for rahul.ch
0
2K
Member Avatar for Monkey101

Hello everyone, I am confuse to what my professor is asking for Part 4 of our project. --> The fourth method for you to develop must manipulate the Colors within a given box. To compute how much manipulation to do on a Pixel from its LOCATION (x,y), the function defined …

Member Avatar for Taywin
0
105
Member Avatar for sobias

Hi guys, I'm trying to solve a problem recusrively. I'm asked to multiply two numbers with only using Addition,Subtraction and Comparison. After looking around the internet, it seems that the Algorithm I should use is Egyptian Algorithm . [Click Here](http://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication) I would like some tips on how to solve this. …

Member Avatar for sobias
0
1K
Member Avatar for tarareddy

i found this code for pacman i want some one to explain me how it works i am new to java game programming so my doubts might be silly for few of u i just understood the array part of creating the maze i have written all my doubts thank …

Member Avatar for tarareddy
-1
6K
Member Avatar for yen.ho.100

Hello everyone, I am pretty new to java and i have an assignment that to write the code for clock in and clock out for employee .Down here is my code, and now i am stuck with the while loop to print out the name, like if Bob work on …

Member Avatar for stultuske
0
88
Member Avatar for Viped

Hi, I am trying to make my own 3d engine and got problem with picking / shooting. Actually I dont even know where to start with that. I have tried find tutos over internet but I did not find any thats useful. Maybe U guys can help me? Anything from …

Member Avatar for ~s.o.s~
0
436
Member Avatar for Monkey101

Hello everyone, I need help with my program. The program has to randomize the array indexs. I am having a huge issue with this: import java.util.Random; //to generate random #'s public class Array { public static void printIntArray(int[] myParamVar) { int LOCATION = 0; while(LOCATION < myParamVar.length) { System.out.print("In LOCATION …

Member Avatar for Nutster
0
87
Member Avatar for Rasheed1988

Hi, I have 2 Columns in DB ex: EMP_Name,age I want to display 3 Columns in Jtable EMP_Name,age,Minor?(it will be check box always false) EMP_Name and Age Column will be Readonly. Please suggest me how to achieve this?

Member Avatar for JamesCherrill
0
157
Member Avatar for UNDER-18 FG

Hi, I was assigned by my teacher to create a simple calculation program about movie tickets that are sold in a local movie theater. So, I created the coding, and it turned out perfect. Here it is: import java.util.Scanner; public class MovieTheater { public static void main(String[] args) { String …

Member Avatar for UNDER-18 FG
0
317
Member Avatar for mark.cueva1
Member Avatar for jalpesh_007
-1
170

The End.