Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1971 > unrolled thread

Data Encapsulation Question

Started bysubhabangalore@gmail.com
First post2012-08-10 08:49 -0700
Last post2012-08-12 21:40 -0700
Articles 5 on this page of 25 — 6 participants

Back to article view | Back to comp.lang.java.help


Contents

  Data Encapsulation Question subhabangalore@gmail.com - 2012-08-10 08:49 -0700
    Re: Data Encapsulation Question Joerg Meier <joergmmeier@arcor.de> - 2012-08-10 18:30 +0200
    Re: Data Encapsulation Question Jeff Higgins <jeff@invalid.invalid> - 2012-08-10 12:44 -0400
    Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-10 12:13 -0700
      Re: Data Encapsulation Question Lew <lewbloch@gmail.com> - 2012-08-10 12:32 -0700
        Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-10 12:58 -0700
          Re: Data Encapsulation Question Lew <lewbloch@gmail.com> - 2012-08-10 15:37 -0700
            Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-10 21:59 -0700
      Re: Data Encapsulation Question Roedy Green <see_website@mindprod.com.invalid> - 2012-08-11 12:12 -0700
        Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-11 13:29 -0700
          Re: Data Encapsulation Question Joerg Meier <joergmmeier@arcor.de> - 2012-08-11 22:35 +0200
            Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-11 13:46 -0700
              Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-11 14:13 -0700
                Re: Data Encapsulation Question Jeff Higgins <jeff@invalid.invalid> - 2012-08-11 17:29 -0400
          Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-11 13:40 -0700
            Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-11 23:09 -0700
              Re: Data Encapsulation Question Jeff Higgins <jeff@invalid.invalid> - 2012-08-13 08:24 -0400
          Re: Data Encapsulation Question Roedy Green <see_website@mindprod.com.invalid> - 2012-08-12 07:50 -0700
            Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-12 12:59 -0700
            Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-12 12:55 -0700
    Re: Data Encapsulation Question Lew <lewbloch@gmail.com> - 2012-08-10 12:31 -0700
    Re: Data Encapsulation Question Roedy Green <see_website@mindprod.com.invalid> - 2012-08-11 12:08 -0700
    Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-12 13:03 -0700
      Re: Data Encapsulation Question Lew <noone@lewscanon.com> - 2012-08-12 13:24 -0700
        Re: Data Encapsulation Question subhabangalore@gmail.com - 2012-08-12 21:40 -0700

Page 2 of 2 — ← Prev page 1 [2]


#1975

FromLew <lewbloch@gmail.com>
Date2012-08-10 12:31 -0700
Message-ID<91570b9a-ab1d-4bb6-8d28-3b26621327e3@googlegroups.com>
In reply to#1971
(unknown) wrote:
> I am a new learner of Java language. I was trying to write the following code for Data Encapsulation. I am using Eclipse as IDE.

At some not-too-distant point you should also learn two other ways, 
command line and Ant.

http://docs.oracle.com/javase/7/docs/technotes/guides/javac/index.html

> But how can I compile this code, I am not getting. If any body may help. Please also let me know if the code is fine,too.

Eclipse menu: Project => Build project

> ********************************************************************************
> 
> public class Box {
>   private int size;
> 
>   // Provide public getters and setters
>   public int getSize() { return size; }
> 
>   public void setSize(int newSize) {
>     size = newSize;
>   }
> } 
> 
> public class BoxMain {
> 	/**

Don't use TAB characters to indent code you publish publicly,
e.g., here on Usenet.

It's fine for examples like here, and kudos for providing such a 
good example, but in real code you should complete the Javadocs.

> 	 * @param args
> 	 */
>  	public static void main(String[] args) {
> 		//create instance of Box

Yeah, the code already says this. The comment is a bit unnecessary.

> 		Box b=new Box();
> 
> 		//access methods trough box objects
> 		b.setSize(25);
> 
> 		System.out.println("Size:"+b.getsize());
> 	}
> 
> 		// TODO Auto-generated method stub
> 	}

Eclipse preferences let you set editors to "Insert spaces for tabs".

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#1985

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-08-11 12:08 -0700
Message-ID<2dbd28h6jc4050pm2vu93fco37v5qanuvu@4ax.com>
In reply to#1971
On Fri, 10 Aug 2012 08:49:19 -0700 (PDT), subhabangalore@gmail.com
wrote, quoted or indirectly quoted someone who said :

>I am a new learner of Java language. I was trying to write the following code for Data Encapsulation. I am using Eclipse as IDE.
>But how can I compile this code, I am not getting. If any body may help. Please also let me know if the code is fine,too.

I don't see anything wrong with your code.  I would have just used one
class myself. What happens when you try to compile?
-- 
Roedy Green Canadian Mind Products http://mindprod.com
A new scientific truth does not triumph by convincing its opponents and making them see the light,
but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
~ Max Planck 1858-04-23 1947-10-04 

[toc] | [prev] | [next] | [standalone]


#1997

Fromsubhabangalore@gmail.com
Date2012-08-12 13:03 -0700
Message-ID<4400c7f4-125e-43b1-9c58-a97d68841605@googlegroups.com>
In reply to#1971
On Friday, August 10, 2012 9:19:19 PM UTC+5:30, (unknown) wrote:
> Dear Group,
> 
> 
> 
> I am a new learner of Java language. I was trying to write the following code for Data Encapsulation. I am using Eclipse as IDE.
> 
> But how can I compile this code, I am not getting. If any body may help. Please also let me know if the code is fine,too.
> 
> 
> 
> *********************************************************************************
> 
>                                 THE CODE
> 
> ********************************************************************************
> 
> public class Box {
> 
> 
> 
> private int size;
> 
> 
> 
> // Provide public getters and setters
> 
> 
> 
> public int getSize() { return size; }
> 
> 
> 
> public void setSize(int newSize) {
> 
> size = newSize;
> 
> }
> 
> } 
> 
> 
> 
> public class BoxMain {
> 
> 
> 
> 	/**
> 
> 	 * @param args
> 
> 	 */
> 
> 	public static void main(String[] args) {
> 
> 		//create instance of Box
> 
> 
> 
> 		Box b=new Box();
> 
> 
> 
> 		//access methods trough box objects
> 
> 
> 
> 		b.setSize(25);
> 
> 		System.out.println("Size:"+b.getsize());
> 
> 		}
> 
> 
> 
> 		// TODO Auto-generated method stub
> 
> 
> 
> 	}
> 
> 
> 
> Thanks in Advance,
> 
> Regards,
> 
> Subhabrata.

Dear Sir,
We solved it last night only. There may be some mis conception there.
Regards,
Subhabrata. 

[toc] | [prev] | [next] | [standalone]


#1998

FromLew <noone@lewscanon.com>
Date2012-08-12 13:24 -0700
Message-ID<k093d2$tdp$1@news.albasani.net>
In reply to#1997
subhabangalore@gmail.com wrote:
> We solved it last night only. There may be some mis conception there.

This is not a misconception, rather the normal way of Usenet.

Usenet is a discussion forum, not a help desk. People will continue to discuss 
matters as long as they find value in doing so. This benefits future readers 
who might see a similar issue. Latency between reading and writing also signifies.

You need not respond to everyone's comment. If someone asks you particularly 
for some information or otherwise addresses you specifically, yes, otherwise 
assume the post is for benefit of the general public.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#1999

Fromsubhabangalore@gmail.com
Date2012-08-12 21:40 -0700
Message-ID<8a9daa04-76ee-4184-a1bd-546263a5683d@googlegroups.com>
In reply to#1998
On Monday, August 13, 2012 1:54:03 AM UTC+5:30, Lew wrote:
> subhabangalore@gmail.com wrote:
> 
> > We solved it last night only. There may be some mis conception there.
> 
> 
> 
> This is not a misconception, rather the normal way of Usenet.
> 
> 
> 
> Usenet is a discussion forum, not a help desk. People will continue to discuss 
> 
> matters as long as they find value in doing so. This benefits future readers 
> 
> who might see a similar issue. Latency between reading and writing also signifies.
> 
> 
> 
> You need not respond to everyone's comment. If someone asks you particularly 
> 
> for some information or otherwise addresses you specifically, yes, otherwise 
> 
> assume the post is for benefit of the general public.
> 
> 
> 
> -- 
> 
> Lew
> 
> Honi soit qui mal y pense.
> 
> http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

That is nice. Thank you.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.help


csiph-web