Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

1 Visitor Messages

  1. View Conversation
    hi i am new here and started to study java programming (almost a week now).
    I have project that is called image comparison.
    This is the problem description.
    1.Program will convert image (jpg) to RGB values and send this values to csv file.
    2.program will identify the differences of the test image compare to the original image.
    -- Compare Red average ,Green Average and Blue average of original image to test image
    this what it looks like. Hope you can help me regarding on this..see attached
Showing Visitor Messages 1 to 1 of 1
About OA-OD-JD1

Basic Information

About OA-OD-JD1
Biography:
I'm a high school student studying Java development in my free time.
Location:
Australia
Interests:
Sports, Programming, Web Development, Forums
Occupation:
Student
Java Skill Level:
Beginner

Signature


Statistics


Total Posts
Total Posts
69
Posts Per Day
0.08
Visitor Messages
Total Messages
1
Most Recent Message
March 20th, 2012 10:18 PM
Total Thanks
Total Thanks
9
  • Thanked 1 Time in 1 Post
General Information
Last Activity
August 25th, 2012 04:35 AM
Join Date
January 22nd, 2012

5 Friends

  1. copeg copeg is offline

    Super Moderator

    copeg
  2. Freaky Chris Freaky Chris is offline

    Senile Half-Wit

    Freaky Chris
  3. JavaPF JavaPF is offline

    mmm.. coffee

    JavaPF
  4. newbie newbie is offline

    Forum Squatter

    newbie
  5. Norm Norm is offline

    Super Moderator

    Norm
Showing Friends 1 to 5 of 5
View OA-OD-JD1's Blog

Recent Entries

Enhanced For Statement - JavaDevelopmentForums.com

by OA-OD-JD1 on January 29th, 2012 at 04:08 PM
When working with arrays, there's an easier way to loop through the indices than manually doing so. We can use the enhanced for statement for this.

class Class1{
   public static void main(String args[]){
	   int aryOne[] = {3,4,5,6,7};
	   int total = 0;
	   for (int x: aryOne){
		   total += x;
	   }
	   System.out.println(total);
   }
}

First of all, we create our array (aryOne) and use

Read More

Categories
Uncategorized

Array Elements As Counters - JavaDevelopmentForums.com

by OA-OD-JD1 on January 29th, 2012 at 04:07 PM
We're going to build a program to re-enact a dice being rolled one thousand times. We're going to output how many times each face of the dice is rolled.

import java.util.Random;
 
class RollDice{
   public static void main(String args[]){
	   Random rand = new Random();
	   int freq[] = new int[7];
 
	   for(int roll = 1; roll <= 1000; roll++){
		   ++freq[1 + rand.nextInt(6)];
	   }
	   System.out.println("Face\tFrequency");

Read More

Categories
Uncategorized

Summing The Elements of An Array

by OA-OD-JD1 on January 29th, 2012 at 04:02 PM
Say we have an array with ten indices. Below is how we can calculate the sum of these indices.

class Class1{
	public static void main(String args[]){
		int[] array1 = {1,2,3,4,5,6,7,8,9,10};
		int total = 0;
 
		for(int counter = 0; counter < array1.length; counter++){
			total += array1[counter];
		}
 
		System.out.println("Total\t" + total);
 
	}
}

Firstly, initialise

Read More

Categories
Uncategorized

Arrays

by OA-OD-JD1 on January 29th, 2012 at 04:01 PM
Arrays are used to store many values under the one variable, so to speak. You can initialise an array the long and drawn out way by manually assigning each index a value or you can implement an array initialiser to do the job for you.

class Class1{
	public static void main(String args[]){
		int array1[] = new int[10];
		array1[0] = 87;
		array1[1] = 543;
		array1[2] = 65;
		System.out.println(array1[2]);
 
		int array2[]

Read More

Categories
Uncategorized

Random Number Generator

by OA-OD-JD1 on January 29th, 2012 at 04:00 PM
Random numbers can be used in Java. Here's a small random number generator and how it works.

import java.util.Random;
class Class1{
	public static void main(String args[]){
		Random dice = new Random();
		int number;
 
		for(int counter = 1; counter <= 10; counter++){
			number = dice.nextInt(6) + 1;
			System.out.println(number);
		}
	}
}

First of all, we need to import the random class.

Read More

Categories
Uncategorized