What is happening in the program?
Hi friends,
i was going through this program, and i could not understand why its not printing anything.
class A {
String str1 = "";
String str2 = "";
String getA() {
return str1;
void setA(String s) {
str1 = s;
String getB() {
return str2;
void setB(String s1) {
str2 = s1;
class B extends A{
public class N {
public static void main(String a[]) {
A aobj = new A();
A aobj1 = new B();
aobj.setA("Sun");
aobj.setB("Java");
aobj1.getA();
System.out.println(aobj1.getA());
}
I think you may have a typo.
You are calling setter methods on aobj:
aobj.setA("Sun");
aobj.setB("Java");And then calling a getter method on aobj1:
System.out.println(aobj1.getA());aobj and aobj1 are different objects. You never call a setter method for aobj1, so its member attributes are still initialised to empty strings...
Cheers, Neil
Similar Messages
-
What is happening in the most recent keynote when I click on a slide and it pulses (larger-smaller) Two of my slides have disappeared in the navigator although if I play through them they are there and the slides have their orignal number--there are just white spaces where the slide should be and I can only get to the slide by clicking through from the prior slide. How do I get the sldies back into the navigator so I can see them. Oddly, they are show up just find on the light table.
Try removing any transitions or builds on these slides, or delete the slides then recreate them as fresh slides.
There are many playback anomalies in Keynote 6 which Apple have said they will be sorting out next year. -
what will happen to the stuff in my keychain after today? I don't want iCloud. Can I keep the keychain in my system under lion? Can someone please help me?
Thank you Sig. Well I keep all my passwords in my keychain. I'm concerned I'll lose them after today. I understand that keychain will be obsolete after today. I don't want icloud either, because I don't want all my personal info on a server. I want to keep my personal information in my system. Am I making any sense? Can you make any suggestions or offer any insights around this?
-
What will happened in the excise while we sent free goods @ samples
what will happened in the excise while we sent free goods @ samples
Dear maha,
What ever the Transactions(Except Exports)..you have to pay the Excise duty and Cess.
Regards
Luckky -
I have Adobe Photoshop Album 1.0 & suddenly cannot send photos thru e-mail. It looks like it's working ok; but when I hit Send nothing happens and the program stops responding. Any suggestions?
I have starter 3.0 and cannot share pictures via outlook express. Evidently that version is discontinued and my outlook express does not support the MAPI that is required. I think the only solution is to upgrade to photoshop
elements or to send photos as attachment to your e-mail. I have the same problem using Zoom Browser EX sending photos via internet. I spent a whole day trying to resove this issue and have exhausted all options. Just like "Instant share" in HP image Zone that was replace by photoshop album starter 3.0 and now it is out dated. -
I have bought Canon EOS 70 D and have Photoshop Elements 12. I need RAw 8.2 and the program has 8.0.
I have tryed help - update and it is searching for hours. Nothing happens. The program is installed yesterday.Are you updating from the Editor, if not go to Expert Mode and click:
Help >> Updates
But check first under the Help menu that you are signed-in - your email address used for you Adobe ID should be visible. You should be able to update to v8.5 -
What does this mean: "The program can't start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem"? I tried reinstalling, but I get an error message saying something about permission to launch services.
Solving MSVCR80 issue and Windows iTunes install issues.
-
What will happen to " the new iPad " I bought 2 months ego. Now the model is discontinued . What apple will do?....really disappointing.
I just bought two new iPads a few weeks ago. If they're still in the return window they're going back. Maybe it's time to look at some of the Android tablets since all of a sudden Apple thinks the mini is a great idea.
-
What has happened to the iPad 2 finger select and drag technique?
Since upgrading to iOS7 it does not work?
I used this all the time to select multple images, approx 75 from an SD card containing 1000 images. Its painful indvidually selecting the imagesWhat would you like us to tell you? If it doesn't work, there is nothing that we users can do about it.
Please submit your feature request to Apple at this link: http://www.apple.com/feedback -
If I take my bank card details off my itunes account and opened a new itunes account what would happen to the old account?
you're more likely to get quick and accurate answers to an iTunes question in the iTunes forum, this is the GarageBand forum
-
If I take my bank card details off my itunes account and open a new itunes account what will happen to the old account?
you're more likely to get quick and accurate answers to an iTunes question in the iTunes forum, this is the GarageBand forum
-
What is happen when the screen goes white
what is happen when the ipod screen is going blank
what is happen when the ipod screen is going blank
-
What will happen to the data I´ve in my Key ring when migrating to iCloud
What will happen to the data I´ve in my Key ring when migrating to iCloud?
Any feedback is appreciated
UweHi Winston!
Thanks for your quick response. I meant keychain items. So I you anserwed my question, perfectly.
Best
Uwe -
What is happening to the pictures sent with text messages?
What is happening to the pictures sent with text messages?
We don't know unless you give us a little more detail as to what the problem is.
-
What has happened to the wonderful, independent, DTP section of Pages?
What has happened to the wonderful, separate, Desk Top Publishing section of Pages?
Since upgrading, I am no longer able to:
See my column markers when layout view is enabled
I cannot identify the colours I regularly use in my magazine layouts as those colours are no longer shown on the palette
I cannot find the flow buttons that used to exist in the bottom right hand corner of the text boxes and can no longer get text flowing from one page to another.
I work in collaboration with someone else in magazine production and we need to be able to liaise with regard to the formatting. this is now very difficult. I need this sorted ASAP as we are working to a deadline.Go back to Pages '09:
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&mforum=iworktips ntrick
For a full list of the Additions/removals and changes in Pages 5:
http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
Review/rate Pages 5 in the App Store.
Peter
Maybe you are looking for
-
Key Figure units in Fact Table - Error
All - When a run a report off of a cube, some row display 0 when there are corresponding values in my cube. The report doesn't agree with LISTCUBE. I have ran transaction RSRV on my cube and tested the "Key figure units in fact tables of Infocube"
-
I converted to FCP X and need to author DVDs from the footage I shot. Since I still have DVD Studio Pro I imported the footage, authored the DVD and burned it. It won't play on my DVD player, Blu Ray player or even my Mac. In the build I get notes t
-
Computer freezes after software install
after i updated to the newest version of snow leapord my computer will freeze/and or restart during use. also, i now cannot access my system prefereces. what does all of this mean?
-
HOw to make AE render my imported sound?
I imported a sound and layered it in the comp but AE doesnt render it in preview nor in final movie. It says that the sound option is set to off in the render settings but i see no where i can change that. What can i do?
-
Funds Management - Reconstruct payment data
Hello, I have implement Funds Management with Multi-Year Budget Execution and update profile 00101 (posting date) and realize that my commitment item for vendor account was 40 and not 60 so I have some invoices that are not updated with the payment i