# security query

sajanjoseph (sajan@teil.soft.net)
Thu, 29 Jul 1999 14:55:25 +0530

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Alan Greenspan: "2 questions regarding class loaders"
- Previous message: Ngiam Kee Jang: "Applet and Files Problem"

    Date: Thu, 29 Jul 1999 14:55:25 +0530

    From: sajanjoseph <sajan@teil.soft.net>

    To: java-security@java.sun.com

    Subject: security query

hi
Following Scot Oak's book i wrote the following java classes

public class MyCard
{
public String acctNum = "222111";

}
in file Mycard.java

and

import java.io.*;
public class CardTester
{
public static void main(String[] args)
{
MyCard card = new MyCard();
System.out.println("Account Number is :"+card.acctNum+"\n");
}
}
in CardTester.java

i compiled them into class files
now i changed public attribute of acctNum in MyCard.java into private
and compiled that class only
Now when i run CardTester class it is accessing acctNum
but gives IllegalAccessException when i give -verify when i run the
class
Why is this acting so?Is the bytecode verifier not checking all accesses
when i don't give -verify ?
It will be great if you can give me some answer
regards
Sajan

    --

    --
    Meet me at   http://www2.crosswinds.net/~sajanjoseph

    The Road goes ever on and on
    Down from the door where it began
    Now far ahead the Road has gone
    And I must follow if I can
    Pursuing it with weary feet
    Until it joins some larger way
    Where many paths and errands meet.
    And whither then? I cannot say

     Next message: Alan Greenspan: "2 questions regarding class loaders"
     Previous message: Ngiam Kee Jang: "Applet and Files Problem"