newtojava

Greenhorn
+ Follow
since Aug 10, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by newtojava

Hi Lancy
Thanks for the reply.Could you pls explain some more on this topic.This is educational and more helpful than reading a book.
Thanks a lot in advance.
23 years ago
Hi:
Could anyone pls explain why I'm getting the following error.
My classpath is set to : .;G:\CorejavaBook
Then I created a package under G:\Corejavabook\Corejava --->
package corejava;
public class myclass
{
public myclass()
{
System.out.println("New Object of myclass:" );
}
protected void bite()
{
System.out.println(" In bite");
}
}
When I write the following Class to access the Protected func--->
import corejava.*;
public class cake extends myclass{
public cake()
{
System.out.println("cake constructor");
}
public static void main(String[] args)
{
myclass x = new myclass();
x.bite();
}
}
I get a error "Can't access protected method bite".I'm new to Java, could you pls explain why can't I access the protected method. From what is in the book, protected is accessible in subclass in other packages.
Thanks in advance.
newtojava
23 years ago
got it frank .
thank's a lot.
regards
hey nalini,
this is the list given in the sun site.
so it is more appropriate to follow according to sun .
Java2.0 Language Keywords
Here's a list of Java's keywords. These words are reserved--
you cannot use any of these words as names in your Java programs. true, false, and null are not keywords but they are reserved words, so you cannot use them as names in your programs either.

abstractdouble int strictfp **
boolean else interface super
break extends long switch
byte final native synchronized
case finally new this
catch float package throw
char for private throws
class goto * protected transient
const * if public try
continueimplements return void
default import short volatile
do instanceof static while

* indicates a keyword that is not currently used
** indicates a keyword that was added for Java 2
regards
hi all ,
when i happen to print the same
i mean
char c = 1;
System.out.println( "The char c is: " + c );
the out put is the "char c is "
how come..?
plz clarify