Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble with Development Chapter

 
Harshit Sethi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble with the development chapter in kathy sierra.Please someone suggest me what should i do.Is this chapter in SCJP syllaybus??
 
Prasad Kharkar
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this chapter is in SCJP syllabus
but what is the trouble there?
can you post the question?
 
Harshit Sethi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i am having problem with the type of questions in which one class in some package needs to access some other class in other package for example it inherits that class,then what statements can be used to compile and run the program.
 
Sahil Kapoor
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to compile A class which is usint B class and B class Inherits C class.
First of all you just need to import B class.

Moreover you need to set CLASSPATH or -cp appropriately so that JVM could find A class and B class.

If B class is as follows com.kapoor.B.class then

1) It should be in the same directory structure as mentioned package.
2) you need to direct JVM upto the directory just above com. Dont help it beyond that directory otherwise it would no be able to find your B class.


Similar concept goes for A class too.

Remember your JVM should be able to find both the classes to complete java command without any error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic