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


Groups > comp.lang.java.help > #1979

Re: Data Encapsulation Question

From subhabangalore@gmail.com
Newsgroups comp.lang.java.help
Subject Re: Data Encapsulation Question
Date 2012-08-10 21:59 -0700
Organization http://groups.google.com
Message-ID <fcfc1cd2-ba2e-4afd-ada1-c4244e5838ce@googlegroups.com> (permalink)
References <b55b1e7a-c8d8-453a-8bdb-5a1745f23204@googlegroups.com> <d5304ca1-327f-4395-bce9-bca0a5c67845@googlegroups.com> <af278a8e-f732-43aa-b2fa-1f2cbfe019e9@googlegroups.com> <8d2885fe-0f3e-45cd-9cb9-662b0cde6a3c@googlegroups.com> <c5130c0b-a0c8-4c18-88e6-f50fdbcff598@googlegroups.com>

Show all headers | View raw


On Saturday, August 11, 2012 4:07:06 AM UTC+5:30, Lew wrote:
> (unknown) wrote:
> 
> > Lew wrote:
> 
> >> (unknown) wrote:
> 
> >>> Thanks it worked. The code is working but only "Size:" of System.out.println("Size:"+b.getsize()); is giving error, if you drop it --it is coming nicely.
> 
> > 
> 
> >> "It worked" and "It is giving [an] error" are contradictory statements.
> 
> > 
> 
> >> What error? 
> 
> >
> 
> >> Why did it happen?
> 
> > 
> 
> > I said it worked because, the main module worked. That is core code. Anything we are giving within " " string notation(unless it is a string manipulation code) it is sort of comment only..Right? 
> 
> 
> 
> Not right at all. It is a program object and nothing at all even in the slightest like a comment.
> 
> 
> 
> > May be some typing mistake I am doing.
> 
> 
> 
> You need to answer my questions.
> 
> 
> 
> -- 
> 
> Lew

Hi,
Thank you for taking time with me. 
What I know is that, if you are not manipulating strings like concatenation, search etc. strings can be of two kinds in a code. One is comment which is not compiled. The other one is, the expressions for the variables. These may go like,
 int num1=100;
 int age=60;
 String name="Lincoln";

etc. 

These may be associated with the expression of variables, 

System.out.println("The Denotation of One Hundred in Numerical is:"+num1);
System.out.println("The Age of Independent India is:"+age);
System.out.println("The Name of Famous US President is:"+name);

etc.

Now these expressions are compiled but not part of code because no variable is assigned thus can not be processed, they die where they are assigned. Generally, comments and variable expressions should be congruent with the code because they are the context of code,
but instead of,
System.out.println("Hello World");
If I write
System.out.println("Hello Earth");
or even 
System.out.println("I am not saying Hello to the World,Would you?");

would not matter much as our job is to see if the code is giving proper output which we are trying to assign, so is the case here, if I say,

System.out.println("Century Means:"+num1);
System.out.println(age);
System.out.println("The Name of the opera house is:"+name);

etc.

It does not matter. 
Other than these there is another kind of variable expression like
System.out.println("The Denotation of num1 in word is One Hundred")

Here the String is compiled because the variable is present. But I am not expert in handling in these kind of strings so prefer to avoid. 

Other than this, if I am going wrong anywhere, please let me know, I would be happy to learn and improve. And also let me know your suggestion over this code.

Regards,
Subhabrata. 





 

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web