32,199 Topics
| |
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;} … | |
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 … | |
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. … | |
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, … | |
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 … | |
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 . | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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 … | |
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 … | |
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? | |
compare and contrast the latest versions of eclispe, netbeans and jgrasp integrated development environments. | |
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? | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
Hello, I need help with code of sum and average, with a -100 to exit. |
The End.