Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can you please tell me what happens to the constructor in the example of INHERITANCE?  RSS feed

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Java Cowboy
Sheriff
Posts: 16082
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting an error? If so, then what's the error?

The only line that's wrong in your example is line 18 - there is a space in there that shouldn't be there, and the method is not called PrintIn but println (with a lower-case p and lower-case L and not an upper-case I).
 
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the quotes on line 18. They should be ". Did you copy this code from Word or some program like that?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not find any thing wrong in the code except line 18. Correct your code to System.out.println(t.i); then it will work fine.
 
shoeb sayyed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at connectivity.Test.main(Test.java:22)
 
shoeb sayyed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it resolved

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!