I want to start learning python. Lots of people I know say it's a very good language. Right now I know Java and a little bit of C++, but I'd like to experiment with some other languages, specifically Python. Right now I've got Python 2.4 installed on my PC, now I need to know what to do from...
What does an " ')' expected " error signify? How did I not use parentheses correctly?
The error is in this line:
System.out.println(num1 + " " + num2 + " " + num 3 + " " + num4 + " " + num5) ;
What possible mistake can there be in parentheses?
I'm writing a program that likes to test for equality simply by checking identity: IOW, a.equals(b) iff a == b.
Now, I think I would like to use HashMap's and stuff... so I would like to be able to use the appropriate accompanying hashCode method... that is, the default implementation of the...
http://www.falstad.com/mathphysics.html
I cannot begin to estimate the love affair I will have with this site.
This just seems like an invaluable tool for students, and anyone at all who is even passively interested in math and physics.
(I apologize if it has already been mentioned...
hi,
i know there are 7 ways to declare main in java
as
1.public static void main(String args[])
2.static public void main(String args[])
but what are the other ways?
but only change first two keywords
i.e. public and static
and use the required keywords.
this is the question...
Your task is to create a Java program with the name that asks the user for 5 integers in the main method that are between 0 and 9, inclusive. You should then write a method called “permutations” which accepts these 5 integers and prints all possible permutations for those numbers. (Hint: You...
Computer Science Java Programming Help!
Determine whether or not an integer given by the user is a prime number. You may assume that the number is greater than or equal to 2. You may conditions that are in the form “if x is divisible by y” when writing your algorithm.
HINT: One way of...
hello everyone, thanks for taking ur time reading this po
i need help with something to do with java, designing an application to read sentences & words from a txt file, and create a new txt file, with all the words (in single) from the original txt file, next to each word, containing the...
Hey I hava a java programming assignment for my intro to java class... I've written my program but I don't know how to make the "new balance" my balance for the second time it runs and so on..
Q)Save the programs as ccard1. Take a credit card balance of $500. Calculate the 5 months the...
Hi, I'm working through the "Building an Application: Part 2: Introduction to Inheritance, Panels, and Layouts" on java.sun.com and the code I've written compiles fine, but the images that are supposed to appear in the JPanel aren't there.
jl = new JLabel("Java Technology Dive Log", new...
Alright, I did the whole Hello World! thing, but I got stuck on one part.
I downloaded the Sun.Java thing, but now when I go into the command prompt and to try and compile it... the computer does not recognize the "javac" command.
What's going on? Is there another program?
Next semester I plan on taking a comp science class, and my school seems to mainly teach java. I always considered the standard language to be c++, I think it was a few years ago here, but I guess they recently switched over.
My questions are:
Are there any major differences...
So, I have to create a program that makes a new array with 20 slots, then it asks you to enter a value into each index, which I have here:
import java.io.*;
class ArrayLoop
{
public static void main (String[] args) throws IOException
{
int[] array = new int[20];
for (int i...
In terms of enterprise web development why would you choose Java over Python/Perl/PHP? I ask this question because I've done significant web development with both Python and PHP and have recently been dabbling with jboss/tomcat/j2ee and have found that Java is very cumbersome. Not only is it a...
[SOLVED] Importing Images to a Java frame
Hey guys,
I have a very simple java program. I opens a frame, and I want to be able to put a picture in the frame. How do I import a picture and set it as the background to the frame?
Here is my simple program:
import java.io.*;
import...
How would i write a program in java such that if you input an array, it returns the mode of the array. IF there is more than one mode, return the first mode.
Here is my code so far:
any help is appreciated!
thanks
I need JAVA's Macintosh runtime environment, I have Mac OS X 10.1.5, and need it ASAP today. Any comments are welcome.
Thank you.
...I'm A straight A student, and working my ass off in JAVA and, I'm still getting a D... I need this now so I can work on it at home as well as overtime at...
Hello all:
I need to write a program that takes an array of 0's and 1's and converts them into base 10 numbers. Here is my code, but I can't get it to return the correct base 10 number.
/* This program returns a value in base 10 from an array of binary numbers.
*
*/
public...
public class check
{
public boolean isDifferent(int [] a, int [] b)
{
for(int i=0; i < a.length; i++) //loop through your a array
{
for(int j=0;j<b.length;j++) //next loop through your b array
{
if( a[i] != b[j] ) // check for...
Hello all
I am trying to write a program that checks whether one array is contained in another array. For example,
A = {1,2,3}
B= {1,2,3,4,5,6}
A is contained in B, so we print out true, otherwise we print out false.
Any advice or tips in writing this program would be greatly...
As a very beginner to java a very basic question is in mind.in every java program we write the first line after mentioning the name of the class as
____________________________________
public static void main(String[] args)
_____________________________________
so i want to know the...
I know that in an array called math[][], the "math.length" will give me the length, or "width" of the array. What is the notation for the "height"?
Ex, if math[][] was a 12x15 array, then math.length=12. how would I get the # 15?
Question: Write a program which displays a random math addition question, asks the user for the answer and tells them whether they are correct or not.
ok, what is the command in java that creates an random math additon question?@#$% I have never heard of something like this before!
Ok, I posted this in the software forum a this afternoon, but I guess all the java gurus are on vacation. So I thought I'd post it here. This is my problem:
Ok, I have a new problem.
This time I'm trying to make a program that prints all the prime factors of a given number and the 29...
Is there a library in java I can use to make AVL trees.
See we have this project where we have to store students in a Binary search tree and then have access to their stuff... anyway is there a structure I can just import to be able to use it... or do I have to implement my own generic tree?[
Ok, guys, I need some help here. This was done using Java, by the way. One of the homework questions we had a while ago was to create a frame and within the frame create two panels and on the two panels create three buttons using BorderLayout. Here's what I had:
import javax.swing.*;
import...
Hello all
I will be taking an AP Computer Science class this year. We will be learning Java. Can anyone give me a quick understanding of Java? What are its uses? Is it similar to C?
Thanks
Is Java good to learn ?
I just bought JBuilder and installed but it is really slow whenever it is started.
Why ?
I think I won't study it and will choose SmallTakl because I see the word SmallTakl in most of the books in my library.
Any help is appreciated.
I declare my pointer as char* ptr and my function as public boolean FuncFoo() but java compiler complains that I have some problem with identifier right at * and my function is missing the method body...
I couldn't figure out what was wrong with them. Would you please help me ?
Thank you,
In my JFrame, I already draw a 2d star, i would like to make it move around in my frame, but i don't know how to erase the old star when it appears in a new position, can anyone here help me with this ?
Thanks
My program has a slight gui problem. The bottom of my gui (the textboxes) are being cut off. I have no idea why this is happening and I have very little experience with GUIs. Could someone tell me why this is happening and how to fix it/better way of doing it. Thanks
ok here is my code...
Welcome to Java Class!
We're going to learn a bit of Java here, one bit at a time, using real world examples to understand what we're doing. My aim is that all of the Java posted here is executable, so you can try it yourself.
First, before you can make use of any Java programs, you'll...
What's the best way to learn Java. I'm trying to improve my marketability. I don't know any high level programming languages. Well, I had to take BASIC in 8th grade, back when eveyone still used Apple. I also took something called, I think, Q-BASIC? at college. I tried learning C++ or...
Umm...I've tried two java editors on my computer and I'm getting the same installation "error" (not really an error, but whatever). I tried Sun's SunOne Studio and it asked me for the "J2SDK home"...saying that I didn't have one and I needed one in order to solve the files. Likewise, when I...
I want to build a website and signed up in a free web-hosting provider, Angelfire. Because it is free of charge, advertisment pop-ups can't be avoided. Is there any code which I can paste in my website so as to stop the pop-ups? (I don't mind if I need to paste the code in every page of my...