473,473 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

pointer concept

14 New Member
good morning sir,

I need to use pointer concept in Java but there is no pointers in Java. is there any alternate to pointer in Java. call by reference in array....
Oct 27 '07 #1
4 1428
Ganon11
3,652 Recognized Expert Specialist
Why do you need to directly manipulate pointers in Java? Can you explain your problem a little more clearly?

Java actually does have pointers all over the place - when you say

Expand|Select|Wrap|Line Numbers
  1. String myString = new String();
myString is technically a pointer to a String object. Java is very 'user-friendly' by hiding this implementation from you.
Oct 27 '07 #2
uppili4chi
14 New Member
Why do you need to directly manipulate pointers in Java? Can you explain your problem a little more clearly?

Java actually does have pointers all over the place - when you say

Expand|Select|Wrap|Line Numbers
  1. String myString = new String();
myString is technically a pointer to a String object. Java is very 'user-friendly' by hiding this implementation from you.
i will explain you.
i created an array s[5];
and i created another array i want store this array like in this array (Note:- one array like s[] i have to store many array)
if i store the address of that array by using pointer i don it c. how i want to over come this problem...
Oct 27 '07 #3
uppili4chi
14 New Member
i will explain you.
i created an array s[5];
and i created another array i want store this array like in this array (Note:- one array like s[] i have to store many array)
if i store the address of that array by using pointer i don it c. how i want to over come this problem...

this is the code in c:

1.
double arr[5] = { 1, 2, 3, 4, 5};
2.
double mat[5][5];
3.
double * matp[5];
4.

5.
mat[1] = arr; // Won't work
6.
matp[1] = arr; // Works
7.

8.
// Note how the syntax is the same
9.
mat[1][2] = 77;
10.
matp[1][2] = 77;
Oct 27 '07 #4
uppili4chi
14 New Member
i will explain you.
i created an array s[5];
and i created another array i want store this array like in this array (Note:- one array like s[] i have to store many array)
if i store the address of that array by using pointer i don it c. how i want to over come this problem...
Expand|Select|Wrap|Line Numbers
  1.  
  2.       double arr[5] = { 1, 2, 3, 4, 5};
  3.       double mat[5][5];
  4.       double *  matp[5];
  5.       mat[1] = arr;      // Won't work
  6.       matp[1] = arr;   // Works
  7.       //  Note how the syntax is the same
  8.       mat[1][2] = 77;
  9.       matp[1][2] = 77;
this is the code what i told before
Oct 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ypjofficial | last post by:
Dear All, According to OOPs , a base class pointer can to point to derived class object....call this as fact1 But somehow I am not comfortable while understanding this concept. The explanaition...
110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
5
by: Cancerbero | last post by:
Hi (first, excuse me for my bad english) As I know, the semantics for typedef is: typedef A B; I think this makes B a synonym of A, where A is an existing data type. Is that right? Based...
22
by: Neo | last post by:
Hi Folks, #include<stdio.h> int main() { int (*p); int arr; int i;
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
22
by: nick | last post by:
i do not know what is the use of (e.g. void *pt), when will use it. thanks!
2
by: yogesh basediya | last post by:
i want to full detail of pointer concept. means how can i access pointer in my programs? why pointer is always consume 2 bytes? and what is the main concept behind the double pointer?
3
by: ali | last post by:
Hi, When I pass a pointer as an argument of a method, is it safe if I change the data pointed by the argument and return it upon completion ? For example: Object* someFunction(Object* ob)...
13
by: Phil Bouchard | last post by:
I am currently writting a smart pointer which is reasonnably stable and I decided supporting allocators for completion because of its increase in efficiency when the same pool used by containers is...
34
by: Davy | last post by:
Hi all, I am writing a function, which return the pointer of the int. But it seems to be wrong. Any suggestion? int * get_p_t(int t) { return &t; } int main()
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.