Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Object oriented programming with java

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 20-02-2012
Member
 
Join Date: Jan 2012
Posts: 12
Object oriented programming with java
  

Can someone please tell me what an array is, and what are the advantages of using arrays? Also please type a few lines of code demonstrating how you would declare an array and initialize it.

Please help.

Reply With Quote
  #2  
Old 20-02-2012
Member
 
Join Date: Nov 2010
Posts: 72
Re: Object oriented programming with java

Array is mainly significant thing in any programming language. Array is a fixed memory allocation and this will assign the memory for same data type sequence. Array contains multiple values of same types and this all values are set memory at same size. Multiple type of array used in all programming language such as one - dimensional, two - dimensional or can say multi - dimensional.
Declaration of an array:
int new[]; or int new= new int[2]; or int num[] = {5,2,4,8,7,6};

Here is the code of the program:

Code:
import java.util.*;
public class  array{
  public static void main(String[] args){
  int new[] = {50,20,45,82,25,63};
  int a = new.length;
  int w,b,y;
  System.out.print("Given number : ");
  for (w = 0;w < a;w++ ){
  System.out.print("  " + num[w]);
  }
  System.out.println("\n");
  System.out.print("Accending order number : ");
  Arrays.sort(num);
    for(w = 0;w < a;w++){
  System.out.print("  " + num[w]);
  }
  }
}
Reply With Quote
  #3  
Old 22-02-2012
Member
 
Join Date: Jan 2012
Posts: 12
Re: Object oriented programming with java

Thank you so much for your great explanation.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Object oriented programming with java"
Thread Thread Starter Forum Replies Last Post
What are the different types of Object Oriented Programming Languages? fLUTE Software Development 4 11-07-2011 02:39 PM
what is message passing and other terms in Object oriented programming languages? Palnila Software Development 3 08-01-2011 05:23 AM
Scope of Object or variable in Object oriented Programming Languages Dėfrim Software Development 3 08-01-2011 05:20 AM
static methods in object oriented programming Satchel Software Development 5 07-01-2011 08:58 PM
The OOP Object Oriented programming Concept & its principle? Bhavya Software Development 3 25-02-2009 08:16 PM


All times are GMT +5.5. The time now is 06:51 AM.