• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

fully qualified name error

 
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i recently started learning OCA Java SE7 Programmer I and additional course documentation from the institute jumps over subjects pretty fast from time to time, so now i'm stuck importing a class.

I have 2 packages;
The main package


And a package from which  want to import.


The documentation tells me to remove the import statement from 'package javastructuur' and add a 'fully qualified name' to make the code run.
My assumption was to alter the line to

To bad that was not the sollution. Other things i tried didn't work either...

Where am i going wrong in my thinking?
 
Marshal
Posts: 79239
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welome to the Ranch

I hope you own the loi.com domain, because as you will see in the Java™ Tutorials, there are conventions about naming packages.

Justus van der Hulst wrote:. . . to . . .

Tha nly takes care of the first occirrence of Persoon; both occurrences need to be qualified. And you have written Persoon once too iften:- to
 
Justus van der Hulst
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The package name com.loi.student is exactly as it is in the documenttion from the institute... LOI is the institute where i take the course LOI

Your sollution was what did the trick. Thanks!

I attempted a variation of this but apparently not quite the right combination.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Justus van der Hulst wrote:. . . LOI is the institute where i take the course LOI . . .

In which case the package names should start nl.loi.....

Well done sorting the problem out
 
Justus van der Hulst
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Justus van der Hulst wrote:. . . LOI is the institute where i take the course LOI . . .

In which case the package names should start nl.loi.....



I doubt that.

According to this section


From the book OCA Java SE7 Programmer I
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java™ Tutorials link I gave you earlier says to use the web name backwards, so that would produce nl.loi.something.
We took the delete button away ages ago.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way: Why are you studying for a Java7 exam?
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:In which case the package names should start nl.loi.....



I'm afraid that the original Internet naming rules that serve as the basis for Java package path conventions are pretty well shot at this point. After all, news.bbc.co.uk now shows up at news.bbc.com.

The ".com", ".org" and ".edu" conventions were originally laid down with primarily US usage in mind, but as far as I know, nobody ever really vetted who could register for what. A local college was a ".org" before it became an ".edu", for example. So if LOI wants to use com.loi, it's not really an issue. Other than the fact that the actual loi.com domain appears to be owned by a squatter. They do own loi.eu, however!

Just for anyone who's curious, the reason for the package naming convention in Java being what it is is that when you start sharing code between organizations, you want to be able to avoid possible namespace collisions. Since only one person or organization (or, if you're in the USA, 'person'=organization ) can register an Internet domain, tagging your products with your domain name makes everything nice and tidy. Of course, for throwaway stuff and personal use you can use anything that meets the Java syntactic rules.

Personally, for course work, I prefer to add the course ID and maybe student ID to the package path, but that's partly because I used to have to get rid of all the junk left on the systems at the end of the term back when we didn't all use our own computers.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:. . . The ".com", ".org" and ".edu" conventions were originally laid down with primarily US usage in mind, but as far as I know, nobody ever really vetted who could register for what. . . .

No, they didn't seem to. Which is why there are so many XXX.com addresses all over the world. It seems to be a case of first come, first served, even if domain names aren'tt sold.

. . . for course work, I prefer to add the course ID and maybe student ID to the package path, but that's partly because I used to have to get rid of all the junk left on the systems at the end of the term back when we didn't all use our own computers.

Hahahahahahahahaha! Agree there.
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My age is showing. When I started, the word "computer" was used in the singular.

For ".com", plagiarism is the sincerest form of flattery. Everyone wants to look like a big successful US company, and even if it's a big successful ".co.jp", they'll want a ".com" domain. Then again, ".com" is easy to type and remember for a business, so why not?"
 
Justus van der Hulst
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:By the way: Why are you studying for a Java7 exam?



As in the language Java or 7and not 8?

Java because i am almost 44 and don't want to do the job i do untill my retirement and i figured doing Java would give me a good start in moving on to Android programming which in my opinion has a future.
Java 7 because that's the highest this institute had to offer at the moment which was affordable. I figured i'd move upwards when i had this exam.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Justus van der Hulst wrote:. . . As in the language Java or 7and not 8? . . . Java 7 because that's the highest this institute had to offer at the moment which was affordable. . . . .

7 as opposed to 8, not Java® as opposed to Python/C#/etc.

Java7 came out in 2009 and was superseded by Java8 in 2014, so even Java8 is nearly 5 years old. If you look here, you will find that the Java7 exams have been withdrawn. The current version of Java® is Java11, but release numbers now change much faster and it appears that the most recent exam is for Java8.
 
Justus van der Hulst
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Justus van der Hulst wrote:. . . As in the language Java or 7and not 8? . . . Java 7 because that's the highest this institute had to offer at the moment which was affordable. . . . .

7 as opposed to 8, not Java® as opposed to Python/C#/etc.

Java7 came out in 2009 and was superseded by Java8 in 2014, so even Java8 is nearly 5 years old. If you look here, you will find that the Java7 exams have been withdrawn. The current version of Java® is Java11, but release numbers now change much faster and it appears that the most recent exam is for Java8.



They still offer the course, but they have a small notice not that exams for 7 can be take untill 2018/12/31 ..... nice
Have no clue if this was mentioned on the site when i registered in November last year...it for sure wasn't mentioned in the letter i received.
I see a good reason for a refund here. Sigh. And a good reason to just take the course and at the end immediately register for a brush up to 8 ad then take the exam..
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Justus van der Hulst wrote:. . .   . . .

I think I agree with you there.

There is nothing wrong with learning Java7, but there were so many changes in Java8 that you will need an update pretty quickly.
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's nothing wrong with learning any version of Java. Even Java 1.3 would give you enough feel for the shape of the language. I'd say that the rest is refinements and conveniences, but annotations are a pretty big change and they came in at Java 5. Java 7 is, I think where lambdas came in (Java 8?), and my own favorite, try-with-resources.

Fair warning: I haven't seen that many adverts for Android programmers, and the salaries mentioned for them were fairly dismal. A consequence, perhaps of the fact that android apps generally sell for only a few dollars.

But if you know Java and can't find a good Android job, it's still alive and well for general PC applications.
 
Justus van der Hulst
Greenhorn
Posts: 9
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Justus van der Hulst wrote:. . .   . . .

I think I agree with you there.

There is nothing wrong with learning Java7, but there were so many changes in Java8 that you will need an update pretty quickly.



Gonna go ahead with this one, i'm on this train now anyway and at the end i'll try to make a jump to 8 or so... In the mean time i'll e-mail the institute with the fact that the course is a bit antique and see if they'll offer me something nice...

Tim Holloway wrote:There's nothing wrong with learning any version of Java. Even Java 1.3 would give you enough feel for the shape of the language. I'd say that the rest is refinements and conveniences, but annotations are a pretty big change and they came in at Java 5. Java 7 is, I think where lambdas came in (Java 8?), and my own favorite, try-with-resources.

Fair warning: I haven't seen that many adverts for Android programmers, and the salaries mentioned for them were fairly dismal. A consequence, perhaps of the fact that android apps generally sell for only a few dollars.

But if you know Java and can't find a good Android job, it's still alive and well for general PC applications.



Well i have always been interested in the engines behind software. Owned a reverse-engineering device, which i had to stick in the back of my C64 back in the 1980's, written page after page of basic from computermagazines back in the days, played around with various Windows crackers, debuggers and disassemblers to find out how 'those guys' managed to find a licensekey, etc.. I've always been curious how stuff works. For some unexplainable reason even writing a batch file makes me smile.
Now i work for a company that's behind the technical part of television broadcasts and some software enigineers work here, but their knowledge is mostly with Python, Delphi and VB. I figured that a java/android programmer might come in handy in the future for writing tvshow-specific apps...it happens often that tablets are used in tvshows.
My other angle was, if this Java/Android idea wouldn't pay off, i would have a baselayer in understanding coding, which (seasoned coders tell me) would make it not that hard to switch to another language.. And if all fails, i at least have tried.
 
reply
    Bookmark Topic Watch Topic
  • New Topic