32,204 Topics
| |
[CODE]void age() { boolean isValid = false; Calendar user = null; while (!isValid) { System.out.print("Enter Date (mm/dd/yyyy): "); DateFormat df = new SimpleDateFormat("MM/dd/yy"); String s = In.in(); Date date = null; try { date = df.parse(s); } catch (ParseException e) { System.out.println("Date error"); } user = Calendar.getInstance(); user.setTime(date); if (user.getTime().getTime() … | |
I have to work on a method called extract feature which has to check for the pattern i pass to the method in the matrix I pass This is an example pattern = {{0,100,0},{255,255,255},{0,100,0}}; Though I pass any different pattern it has to check for that pattern in the matrix … | |
Hello, i'm new to java and i need to read a file of strings into an array and then sort them but i can't figure out how to do either. i can do it with ints and doubles but i can't with strings. if anyone could help me i'd be … | |
[CODE]import java.io.*; import java.util.*; import java.io.FileWriter; import java.io.IOException; public class Dirtrav { public static void main(String args[]) { // String rootDir="C:\\Projects\\PerfBVT'\\W6_TopicVsQueue_8.2.0.0.74_040110\\"; File directory = new File("C:\\Projects\\PerfBVT'\\W6_TopicVsQueue_8.2.0.0.74_040110"); identifydir(directory); } //File directory = new File("C:\\Projects\\PerfBVT'\\W6_TopicVsQueue_8.2.0.0.74_040110\\"); public static void identifydir(File di) { File[] files = di.listFiles(); if (! di.exists()) { System.out.println("Invalid path"); return; … | |
Using WindowsXP Pro SP3 Problem with javascrip I have installed Javascrip Ver 6.0.190.4 When I try to email a site to submit a query I enter the question but when I click on [NEXT] I get this error:mJavascrip:Void ( ) can you help | |
How can i make the program to tell the user what letter of the alphabet it is: ex: " k is the 11th letter in the alphabet" here is the code that i got so far [CODE]import javax.swing.*; public class Ncom{ String Inputnum; char num; public static void main(String[] args){ … | |
My every figure has centre point with coordinates x, y tips number radius which shows tip range from centre point. i have a drawingRule method which is for every shape i need to draw. [CODE]package business_logic; import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; @SuppressWarnings("serial") public class Vector extends JPanel { public … | |
Hi. I'm new here and need some help. I'm finishing school now and for the finish i need to "make"/program a game or smth. I decided to make a QUIZ in java. I know the basics of java i learned it about 1 year in school. So, i want some … | |
Following me everywhere? why do I get those exceptions very much??? why are they raised?? My classes are always in the same package as the class they accesses them.. I know they are there. Why doesn't the compiler find them???? thanks for your help ppl...please help :@ | |
Hey all - I have to create a basic client browser that creates a socket with a webpage and then uses a command similar to : GET index.html\r\nHTTP/1.1\r\nHost: [url]www.mysite.com\r\n\r\n[/url] To get the source code for the website. I will store each line recieved from the server into an arrayList, which … | |
Hi, I'm having some problems with an infinite loop. For some reason, the process 112 is not being send anywhere. What i'm suppose to to do is to mimic a CPU. Each line represents a process which the first number is the machine time that it suppose to be send … | |
I'm working on a program in which I am using the BorderLayout Manager. However, I'm having a difficult time changing the size of the window. I want to make it longer and more narrow, with only one or two text fields per row and want to make the text field … | |
Hello, I need to read in objects from a binary file and place those objects into an ArrayList. Not sure on how to go about adding the objects - this is what I have so far: [CODE]ArrayList<MailingLabel> arrayOfMailingLabels = new ArrayList<MailingLabel>(); try { ObjectInputStream in = new ObjectInputStream(new FileInputStream("labels.dat")); while … | |
Just need a few pointers with the code below. I have the below class to complete but I am stuck on the isAllValidDigits() method where i have to create a loop to check and return true if all the int values of the authorId array and the programId array are … | |
im creating little program which produces cars, tractors and mopeds. car has 4 wheels and 4 cilinder engine, tractor has same, and moped has 2 wheels and 1 cilinder engine. this is what i have at the moment. next thing i need to do that with 2 factories.. home factory … | |
Hi, I have to do a project on Sudoku. I am finished generating the complete board. Now my major task is to generate a puzzle out of the complete board with the difficulty level. Can some one give me clue to remove the elements randomly from the board. Later on … | |
Hi, I have a rather large binary file that I am attempting to read in, but I only want to read in the first 100 characters or so. I've tried searching the internet for help or an example, but I've only found examples that read in the entire file...and this … | |
hi iam programming bisection method in java but i dont know how to evaluate functions if someone can tell me a class to do it function y=3sinx +cosX example f(a)f(b)<0 | |
Im running windows XP Professional I have all of the latest updates on my laptop and I just downloaded the latest version of SQL Developer but when I try to open the program I receive this error “Unable to create an instance of the java virtual machine.” Ive been looking … | |
| Hey folks :) I was writing some code today, and I wrote a function for computing factorials without use of recursion. What do you think about this one? [CODE]int factorial(N) { int r; r = 0; while (N > 0) { r *= (n-1); n--; } return r; }[/CODE] |
Hi All, I am pretty new to Java and i am having difficulty using overloading on the [I]equals[/I] and [I]compareTo[/I] methods. I have a sample application for a school and i need to check for duplicates in records using the equals and compareTo methods. All records have Firstname, Lastname and … | |
Hi, I am quite new to Comp Sci and I just wrote a program in BlueJ that calculates the value of truth tables and validity in arguments. I followed the book's instructions and have a method with the signature: (It's in the class "Main") public static void main(String[] args) { … | |
Hi! I try to create HashSet of the next object: [CODE] import java.nio.file.Path; public class WatchedPath { public Path dir; public boolean recursive; public Filter filter; // Ctor with only Path - for comparing between the object (comparing is only by the path!) public WatchedPath(Path dir) { this.dir = dir; … | |
1. Create a doubly linked circular list in Java. Each element in the list contains a data which is an object of a Student class and two links, next and previous. 2. The Student class contains two class fields only: • name - The first and last names are in … | |
suppose i created a dequeue class, with methods like insertFront() insertRear() removeFront() removeRear() peekFront() peekRear() isEmpty() isFull() how can i wrap it around and array ?? Will it work the same way as circular does? | |
Hi, I get this error: `Exception in thread "Thread-4" java.lang.NullPointerException` When I try to send the vector to my form. Does someone knows where I made a mistake? Here is a part of my code: (this part is from my clientapplication (where I make a connection with the server) if … | |
Hi i'm implementing a small java program where we have the game running in an applet. After each turn I want the applet to reset to the original setting for the next turn. Basically the game is a football being kicked into the goal. After the goal is made/missed the … | |
I am trying to basically use the methods as functions and then call them in main but I cant figure it out. I thought it could be done like this but maybe I am just confusing my php&mysql class with Java. At the bottom of my code, there is a … | |
[CODE]// this is overkill Date now = new Date(System.currentTimeMillis()); [/CODE] Why is this overkill? | |
Hi all, I have a web app and in the web.xml file there is a filter which is applied to all the jsp files. However I need to change the particular filter so that it is not applied to 1 jsp file. I tried searching in regular patterns if there … |
The End.