Why can private variables be accessed by other instances?

From an OO design perspective, I'm sure this makes sense, but perhaps somebody could articulate it for me so that I can understand the rationale.
I can see that one way of looking at encapsulation is that the object itself should be encapsulated and if you have 2 Person objects, why should one Person be allowed access to another Person's private data?
Why is this not how Java decides to implement access modifiers (i.e. not a per-instance basis)?...I have no idea how other languages do it because I'm new to all this, but perhaps you can explain for me.

I don't know why it was designed that way, but
consider this:public class Example {
private int value = 42;
public void setAnotherValue(Example ex, int
nt newValue) {
ex.value = newValue;
Thanks for your example. Looking at it, it makes me realize that this per-class access is specially meant for access to other instances, because otherwise the method would just look like this, correct?
public void setAnotherValue(int newValue) {
   this.value = newValue;
}How would the runtime check you mentioned look? I couldn't figure out which of the following two you had in mind and are appropriate:
public void setAnotherValue(Example ex, int newValue) {
   if (ex == this)
     ex.value = newValue;
  else
     throw new RuntimeException();
}or this...
Example e1 = new Example();
Example e2 = new Example();
if (e2 != e1) throw new RuntimeException();
e2.setAnotherValue(e1, 57);

Similar Messages

  • Why can I no longer access google from my mac with either Firefox or Safari

    why can I no longer access google from my mac with either Firefox or Safari — both with latest updates loaded. My PC is fine.

    What was before? And what is now?
    It is a good idea to include the machine type and OS version in your problem posts.

  • Why can I no longer access Lightroom 4 tutorials? [was: Lightroom 4]

    Why can I no longer access lightroom 4 tutorials?

    Which tutorials are you trying to access exactly? Got a link?

  • Why can't i sync songs from other sources in my library into my iPhone?

    why can't i play songs from other sources in my liberay that i sync in my phone

    Un-sync all your music to remove it from the device, then restart (hold down the home button along with the sleep/wake button until you see the apple, then let go). Now re-sync your music.

  • Why can't I receive sms from other phones ?

    Why can't I receive sms from other phones ?

    Try going to setting->general->reset-> reset network settings. And see if that works.
    You may also want to contact your carrier and see if there is anything funny going on with your profile.
    Best of luck let me know if this helps.

  • Why can't I get apps from other country apple store?

    Why can't I get apps from other country apple store?

    Carolyn Samit wrote:
    rather than your actual geographic location."
    That statement is false. Copied directly from the iTunes Store Terms and Conditions:
    "The iTunes Service is available to you only in( Insert country name here). You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance."
    You need to be physically located in the country, its territories or possessions whose store you are trying to use.

  • VPN connection works, but can't ping or access any other device on remote network

    I have an OS X Lion server at work (uses a static IP of 192.168.2.10). VPN is setup and works.
    The work network's router has an IP of 192.168.2.1 and hands out IPs of 192.168.2.100-149. The VPN service is configured to hand out IPs of 192.168.2.150-170.
    My home network uses a router with an IP of 192.168.1.1 and hands out IPs from 192.168.1.2-49
    Both routers are using subnet mask of 255.255.255.0
    The problem is, I can connect to the VPN just fine and access all services running on that same OS X server like iChat and AFP file sharing. But, I cannot directly access any other device on the office network like client machines or even trying to log into the router's GUI interface. Pings timeout, etc.
    Example:
    At my home, I have a local IP of 192.168.1.12 and I connect to the work VPN. It assigns me an IP address of 192.168.2.151 and I'm able to connect to iChat on the OS X server that has a static IP of 192.168.2.10
    In terminal, I try to ping the router on the work network (192.168.2.1) and I get no response (even though ICMP response is turn ON). I try to ping another OS X workstation on the work office, and get no response.
    I'm not sure how to fix this, or whether I need to change settings on either router or the server.
    Would greatly appreciate any insight or help on this. Thanks.

    danimalapple wrote:
    I have an OS X Lion server at work (uses a static IP of 192.168.2.10). VPN is setup and works.
    The work network's router has an IP of 192.168.2.1 and hands out IPs of 192.168.2.100-149. The VPN service is configured to hand out IPs of 192.168.2.150-170.
    My home network uses a router with an IP of 192.168.1.1 and hands out IPs from 192.168.1.2-49
    Both routers are using subnet mask of 255.255.255.0
    The problem is, I can connect to the VPN just fine and access all services running on that same OS X server like iChat and AFP file sharing. But, I cannot directly access any other device on the office network like client machines or even trying to log into the router's GUI interface. Pings timeout, etc.
    Example:
    At my home, I have a local IP of 192.168.1.12 and I connect to the work VPN. It assigns me an IP address of 192.168.2.151 and I'm able to connect to iChat on the OS X server that has a static IP of 192.168.2.10
    In terminal, I try to ping the router on the work network (192.168.2.1) and I get no response (even though ICMP response is turn ON). I try to ping another OS X workstation on the work office, and get no response.
    I'm not sure how to fix this, or whether I need to change settings on either router or the server.
    Would greatly appreciate any insight or help on this. Thanks.
    Check the DNS settings on the server (see my earlier post in this thread).

  • Why can I not order music from other countries

    Hello,
    why can I not order music from either germany or austria if the canadian itunes does not have it?
    I don't mind paying in euros or paypal, which ever.
    I think the stores should be compatable or should allow buying from another country.
    Thanks, Ingo

    The short answer is that the content owners do not allow Apple to sell content across country borders. It's not by Apple's choice.
    Regards.

  • Why can't Safari be like the others?

    Why oh why can't Safari be like Firefox who allows you to organize or view your bookmarks by name or jazz up your toolbar? These are such little things in the grand scheme of browser design. Don't they know that Mac users are colorful and creative and would really really really like a little help getting organized? Why should I be forced to use another browser simply because I want these simple features? Come on Apple, meet the competition - I'm feeling punished for my loyalty!

    Hi Again Emlanie.
    I'm suspecting that maybe you were hoping for that really cool import bookmarks feature that FF has. I Iike that myself. 'POOF' it's done! But I don't like it enough to use FF as my main browser. Mulder was right... it really depends on what you want out of it. And as I told you before, I like it clean and simple.
    BUT, if you want bookmarks in Safari, it's really no big deal. Trust me, I set these up my first week of ever using any computer... so I'm pretty sure you can do it.
    My suggestion for setting up Bookmarks would be:
    1.) Decide how you want to categorize your bookmark 'headers' in the bookmarks bar. I do mine by subject: Restaurants, Tickets, Banking and so on. This makes it easier when you add a bookmark, and is more conducive to looking for one later, if you have alot of them as I do.
    2.) Go to Bookmarks in the Safari menu bar and click on 'Show All Bookmarks'. Proceed to make the folders you'll need with your header titles on them by using the '+ add folder' button at the bottom of the left hand column. Make them all.
    3.) Once your done, proceed to drag each folder to the column on the right, starting at the top, and in the order you want them on your Bookmarks Bar. The top will show as the left side of your BM bar and so on to the right. I do mine alphabetically. You may choose to do it by favorites or most frequently visited, whatever. As you drag each folder to the right column in the order you want, it is automatically placed on your BM bar. Now all you have to do is add bookmarks.
    I've checked FF and there is no export feature to Safari (only import, nice trick :o) So, you can add your bookmarks by just visiting your sites and then 'add bookmark' then all you have to do is choose which (already waiting) folder to place it in. Really easy. And I've got loads of bookmarks!
    So.... if you decide you want to try Safari for a bit and see if you like it, I hope this helps a little.
    Good Luck and Have Fun!
    MWN :o)

  • Why can't this program access the private class

    All,
    If you could give me some help I would appreciate it, as I have been worrying this issue for some time now and cannot figure out why this program will not compile. It tells me that there are a number of errors, and it appears that these errors are due to the fact that it will not allow me to reach from the private class to the primary for variables. Now, I have seen another program that is very similar and it does not have these issues. IF someone would explain to me what is going on here I think that I could fix it. Thanks
       import java.io.*;
       import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
       import java.text.*;
       import java.util.*;
       import java.lang.*;
        public class MortgageGUIv4_1 extends JFrame
           public static void main(String[] args)
             new MortgageGUIv4_1();
          double MP, calcAPR, APR, adjustAPR, annualAPR;
          double monthTerm, userTerm;
          double userPrin;
          boolean user = false;
          String headers = "Payment No. \t\tRemainging Balance \tInterest Paid";
          String []loanRates = {"7 years at 5.35%,15 years at 5.5, 30 years at 5.75%"};
           public MortgageGUIv4_1()
             ButtonListener b1 = new ButtonListener();
             JPanel firstRow = new JPanel();
             JPanel fourthRow = new JPanel();
             JPanel fifthRow = new JPanel();
             JPanel sixthRow = new JPanel();
             JPanel seventhRow = new JPanel();
             JPanel fieldPanel = new JPanel();
             JPanel buttonPanel = new JPanel();
             JPanel buttonPanel3 = new JPanel();
             JLabel userPrinLabel = new JLabel("Principle:  ");
             JTextField userPrinvalue = new JTextField(10);
             ButtonGroup loanGroup = new ButtonGroup();   
             JLabel outputLabel = new JLabel("Click to see your payment");
             JButton buttonSubmit = new JButton("Submit");
             buttonSubmit.addActionListener(b1);
             JLabel outputLabel3 = new JLabel("Click here to clear Data");
             JButton buttonClear = new JButton("Clear");
             buttonClear.addActionListener(b1);
             JLabel mortgagePayment = new JLabel ("Your Monthly Payments are");
             JTextField totPayment = new JTextField(10);
             JComboBox termRateBx = new JComboBox(loanRates);
             JLabel termRateLbl = new JLabel("Select a Term and Rate from the options listed");
             JTextArea pymntTable = new JTextArea(headers, 10, 50);
             JScrollPane scroll = new JScrollPane(pymntTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
             try
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                 catch(Exception e)
                   JOptionPane.showMessageDialog(null,"The UIManager could not set the Look and Feel for this applicatoin.", "Error",
                      JOptionPane.INFORMATION_MESSAGE);
             MortgageGUIv4_1 winPane = new MortgageGUIv4_1();
             winPane.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             winPane.setSize(300,300);
             winPane.setTitle("Dan's Mortgage GUI System");
             winPane.setResizable(false);
             winPane.setLocation(200,100);
             winPane.setVisible(true);
             Container cont = getContentPane();
             cont.setLayout((new BorderLayout()));
             fieldPanel.setLayout(new GridLayout(8,1));
             FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER, 5,3);
             firstRow.setLayout(rowSetup);
             fourthRow.setLayout(rowSetup);
             fifthRow.setLayout(rowSetup);
             sixthRow.setLayout(rowSetup);
             seventhRow.setLayout(rowSetup);
             buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
             buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
             firstRow.add(userPrinLabel);
             firstRow.add(userPrinvalue);
             fourthRow.add(mortgagePayment);
             fourthRow.add(totPayment);
             fifthRow.add(termRateBx);
             fifthRow.add(termRateLbl);
             sixthRow.add(scroll);
             fieldPanel.add(firstRow);
             fieldPanel.add(fourthRow);
             fieldPanel.add(fifthRow);
             fieldPanel.add(sixthRow);
             fieldPanel.add(seventhRow);
             buttonPanel.add(buttonSubmit);
             buttonPanel.add(buttonClear);
             cont.add(fieldPanel, BorderLayout.CENTER);
             cont.add(buttonPanel, BorderLayout.SOUTH);
           private class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent e)
                Object source = e.getSource();
             //used the term user because this is the user input.  When the user inputs a correct value then the program moves on
                do
                   //captures the user data entered in the text field and converts it to double
                   String enterAmount = userPrinvalue.getText();
                   userPrin = Double.parseDouble(enterAmount);
                   if(userPrin <0)
                      JOptionPane.showMessageDialog(null,"The Principle value is out of range.  Please choose a value that is greater than 0", "Error",
                         JOptionPane.INFORMATION_MESSAGE);
                   else user=true;
                }while (!user);
                if(source == buttonSubmit)
                //captures the user data entered in the text field and converts it to double
                   String enterAmount = userPrinvalue.getText();
                   userPrin = Double.parseDouble(enterAmount);
                   if(selection.equals(loanRates[0]))
                      APR = 535 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 7 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   if(selection.equals(loanRates[1]))
                      APR = 550 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 15 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   if(selection.equals(loanRates[2]))
                      APR = 575 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 30 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   MP = userPrin * (APR / calcAPR);
                   DecimalFormat twodigits = new DecimalFormat("#,###.##");
                //The system will now render the monthly payment amount
                   totPayment.setText("$" + twodigits.format(MP));
                   double loanBal, newLoanBal, mnthlyIntPd, mnthlyPrinPd;
                   for (int i = 0; i >= monthTerm;i++)
                      newLoanBal = loanBal;
                      mnthlyIntPd = loanBal * APR;
                      mnthlyPrinPd = MP - mnthlyIntPd;
                      loanBal = loanBal - mnthlyPrinPd;
                      pymntTable.append("\n"+i+ "\t\t" + twodigits.format(loanBal)+ "\t\t" + twodigits.format(mnthlyIntPd));
                if(source == buttonClear)
                   userPrinvalue.setText("");
                   pymntTable.setText(headers);
       }Dan

    Thank you one and all, in part to what you said here I when through and obviously had to make some serious changes to the code. Now it will compile however, when I try to run it I am getting the following error. do not use MortgageGUIv4_1.add() use MortgageGUIv4.1.getContentPane.add instead. I am at a loss for this one, as when I looked it up the only difference was that the one is awt and the other is swing. Could someone please let me know what I am missing.
    Thanks
    Dan
       import java.io.*;
       import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
       import javax.swing.event.*;
       import javax.swing.border.*;
       import java.text.*;
       import java.util.*;
       import java.lang.*;
        public class MortgageGUIv4_1 extends JFrame
           public static void main(String[] args)
             new MortgageGUIv4_1();
          double MP, calcAPR, APR, adjustAPR, annualAPR;
          double monthTerm, userTerm;
          double userPrin;
          boolean user = false;
          String headers = "Payment No. \t\tRemainging Balance \tInterest Paid";
          String loanRates[] = {"7 years at 5.35%","15 years at 5.5", "30 years at 5.75%"};
              private JLabel userPrinLabel, outputLabel, outputLabel3, mortgagePayment, termRateLbl;
              private JTextField userPrinvalue, totPayment;
              private JButton buttonClear, buttonSubmit;
              private JComboBox termRateBx = new JComboBox(loanRates);
              private JTextArea pymntTable;
              private JScrollPane scroll = new JScrollPane(pymntTable);
           public MortgageGUIv4_1()
             ButtonListener b1 = new ButtonListener();
               this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             this.setSize(900,500);
             this.setTitle("Dan's Mortgage GUI System");
             this.setLocation(240,0);
             this.setVisible(true);
             JPanel winPane = new JPanel();
             JPanel userPrinciple = new JPanel();
             userPrinLabel = new JLabel("Principle:  ");
             userPrinvalue = new JTextField(10);
             userPrinciple.add(userPrinLabel);
             userPrinciple.add(userPrinvalue);
             ButtonGroup loanGroup = new ButtonGroup();
             outputLabel = new JLabel("Click to see your payment");
             buttonSubmit = new JButton("Submit");
             buttonSubmit.addActionListener(b1);
             outputLabel3 = new JLabel("Click here to clear Data");
             buttonClear = new JButton("Clear");
             buttonClear.addActionListener(b1);
               JPanel results = new JPanel();
               mortgagePayment = new JLabel ("Your Monthly Payments are");
             totPayment = new JTextField(10);
               results.add(mortgagePayment);
             results.add(totPayment);
               JPanel comboBx = new JPanel();
             termRateLbl = new JLabel("Select a Term and Rate from the options listed");
               comboBx.add(termRateBx);
             comboBx.add(termRateLbl);
             pymntTable = new JTextArea(headers, 10, 50);
             JScrollPane scroll = new JScrollPane(pymntTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
             try
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                 catch(Exception e)
                   JOptionPane.showMessageDialog(null,"The UIManager could not set the Look and Feel for this applicatoin.", "Error",
                      JOptionPane.INFORMATION_MESSAGE);
             winPane.add(userPrinciple);
             winPane.add(comboBx);
             winPane.add(results);
               winPane.add(scroll);
               winPane.add(outputLabel);
               winPane.add(buttonSubmit);
             winPane.add(outputLabel3);
             winPane.add(buttonClear);
               this.add(winPane);
           private class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent e)
                Object source = e.getSource();
                String selection = (String)termRateBx.getSelectedItem();
             //used the term user because this is the user input.  When the user inputs a correct value then the program moves on
                do
                   //captures the user data entered in the text field and converts it to double
                   String enterAmount = userPrinvalue.getText();
                   userPrin = Double.parseDouble(enterAmount);
                   if(userPrin <0)
                      JOptionPane.showMessageDialog(null,"The Principle value is out of range.  Please choose a value that is greater than 0", "Error",
                         JOptionPane.INFORMATION_MESSAGE);
                   else user=true;
                }while (!user);
                if(source == buttonSubmit)
                //captures the user data entered in the text field and converts it to double
                   String enterAmount = userPrinvalue.getText();
                   userPrin = Double.parseDouble(enterAmount);
                   if(selection.equals(loanRates[0]))
                      APR = 535 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 7 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   if(selection.equals(loanRates[1]))
                      APR = 550 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 15 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   if(selection.equals(loanRates[2]))
                      APR = 575 / (12 * 100);  //The APR is converted from whole number to % and reduced to the monthly rate
                      monthTerm = 30 * 12;  //The Term must be converted to months
                      adjustAPR= 1 + APR;
                      calcAPR = 1 - Math.pow(adjustAPR, -monthTerm);
                   MP = userPrin * (APR / calcAPR);
                   DecimalFormat twodigits = new DecimalFormat("#,###.##");
                //The system will now render the monthly payment amount
                   totPayment.setText("$" + twodigits.format(MP));
                   double loanBal = userPrin, newLoanBal, mnthlyIntPd, mnthlyPrinPd;
                   for (int i = 0; i >= monthTerm;i++)
                      newLoanBal = loanBal;
                      mnthlyIntPd = loanBal * APR;
                      mnthlyPrinPd = MP - mnthlyIntPd;
                      loanBal = loanBal - mnthlyPrinPd;
                      pymntTable.append("\n"+i+ "\t\t" + twodigits.format(loanBal)+ "\t\t" + twodigits.format(mnthlyIntPd));
                if(source == buttonClear)
                   userPrinvalue.setText("");
                   pymntTable.setText(headers);
       }

  • Why can I not get Access the iTunes in other countries?.

    I would like to be able to buy record albums in the languagess of othr European countries. How is this not possible?

    This gets asked weekly.
    The owners of the copyright material have not licensed it globally.

  • Why can my children lock and erase other family member Apple devices from their Apple ID?

    I recently setup iCloud Family Sharing for our home of 5 people.  My personal and unique Apple ID is the controlling parent ID.  Others in the family are my wife and 3 children (1 over 18 and 2 under 18).  Today I logged into iCloud from one of my kids Apple ID and noticed that it allows him to see everyone elses device location and also gives him the authority to turn on Lost Mode (which locks the device) and to Erase each device.  I then logged out and logged into another childs Apple ID and it was the same thing.  They could each see everyone's devices including my personal Mac Book Pro, both the iPads my wife and I use and the family iMac.
    Essentially that means my kids each have the ability to erase or turn on lost mode for anyone elses device which is kinda scary.  Now, perhaps you are thinking that I somehow messed up and put my kids Apple ID as the Organizer for iCloud family share but I can assure you I did not.  When I go into iCloud to see the hierarchy it clearly shows my Apple ID as the Organizer and the others are simply shown as family members and are not authorized to approve purchases.  I also do not have my kids Apple ID setup on my personal Macbook Pro or my personal iPad as an account so there's no connection that way.
    That said, I also wondered if my kids could really do anything to my personal devices or if it would ask them for my password or lock code before doing anything, so I tried it by logging into my son's iCloud account using his Apple ID.  I located my personal iPad and then told it to turn on Lost mode.  And sure enough it locked my iPad from my son's iCloud account.
    So is this how it's supposed to work or is something wrong with iCloud rights for device management?  It seems totally wrong that my other family members have such control over other family member devices.
    Thanks

    Hello sbrown02,
    Welcome to the Apple Support Communities!
    I understand that you would like to know why the people in your Family Sharing group have access to your location and that ability to put a device in Lost Mode. Lost Mode is a function available with location sharing and can be toggled off or on. Please reference the attached article for more information.
    Family Sharing and location - Apple Support
    Use location sharing with Find My iPhone
    If you join family sharing and choose to share your location with family members, they can locate and secure a missing device for you.
    If you enabled Find My iPhone on your missing device, a family member can:
    See the location and status of your device
    Play a sound on your missing device to help you find it
    Put your device in Lost Mode to help you find it
    If you don't share your location with family members, they will be able to see that your devices are online or offline and play a sound to help you locate your missing device. They won't have access to any location information about your devices.
    Best regards,
    Joe

  • Why can I still not access any of the decent Typekit fonts?

    I've been waiting and waiting hoping that Adobe will finally get around to including all of the typekit fonts within Muse. For example I've been after the Prenton font, but notice that it's still not available from within Muse, and the same applies for many of the really good fonts.
    Why are they not available?
    Thanks

    Hi,
    I am sorry we don't have the same seamless integration with the full Typekit library as we do with Edge Web Fonts. There are two main reasons for that:
    1. Muse is a desktop application, and any use of a font in Muse Design mode is considered "desktop use". Most fonts in the Typekit library are licensed for "web use" only.
    2. Edge Web Fonts  are mostly open-source and can be used by anyone, on any domain, for unlimited page views. On the other hand, web fonts in the Typekit library need to be configured for specific domains and may be subject to page view limits. This configuration — in the form of Typekit "kits" — is done manually. We don't have the necessary means to create kits automatically (something that's needed for a fully seamless workflow).
    Looking through your other posts on various forums, I can see that you already have experience creating kits. Have you tried this workflow for Muse: http://museinsider.com/how-to-add-typekit-fonts-to-your-muse-site.html? If you haven't, please give it a try. If/when you have tried it, please let me know what you find most and least inconvenient about that worflow:
    Creating a kit at typekit.com
    Including embed code in Muse
    Inability to work with the actual font during Design
    Inability to see the actual font during Preview
    Other (please specify)
    Could you also let me know (in private, if you prefer) if you already own Prenton as a desktop/print font?
    Thanks,
    Abhishek

  • Curious - why can some see web page and others cannot?

    I've had a couple people tell me that the link that I have provided for my website (a cut and paste of the URL address) doesn't work and the error msg is that the page does not exist.
    Others can view the site just fine.
    I have, until recently, also been able to view my site without issue but I live in China and it is not unusual for there to be sites temporarily blocked from time to time. I have not been able to bring up my site and thought that this was just due to one of these fun times. But the person not able to access the site is in the US.
    So my question is, what other things could bring up an error msg like that? Since it is a cut and past issue, it can't really be a mistyping of the address so looking for any other things that could cause this.
    Thanks!

    Problem sort of solved.
    However, the person who was having difficulty wasn't able to click on the full address URL but when I gave him the shortened version (the version that comes up on iWeb when you are asked if you want to publish it) it was fine. Not really sure why one works and not the other but a solution was at least found.
    Posting this in case anyone else runs into a similar situation.

  • Why can't you use PipedXputStream in other than threaded application

    I have need for usage of these in a non-threaded application, however the Javadoc indicate this should not be done.
    "Attempting to use both objects from a single thread is not recommended, as it may deadlock the thread."
    As the Java community is composed of some brilliant people, I am curious as to why any limitation of this sort has not been fixed/addressed?
    What is the root cause of these deadlock situations?
    Thanks in advance.
    Steve

    899559 wrote:
    I have need for usage of these in a non-threaded application, however the Javadoc indicate this should not be done.Because using streams in a single thread makes no sense, since you can just use method calls. And that avoids the situation were you could be trying to write more than the stream buffer can hold or trying to read more than you wrote to the stream.
    data = getData();
    outPipe.write(data);
    data = inPipe.read();
    doSomethingWith(data);
    // is just a roundabout way of coding
    doSomethingWith(getData());

Maybe you are looking for