Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird - 'Your data access class must be called "Data.java"'

 
Catalin Mihalache
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

My assignment is URLyBird 1.2.3

There is a very strange request:

"Your data access class must be called 'Data.java', must be in a package called "suncertify.db", and must implement the following interface" (DBAccess)

The very important thing is this request is a MUST. But having a class named 'Data.java' means 3 possibilities:

a)a wrong request from SUN - but this is a MUST so I cannot suppose this is a SUN's mistake.

b) I can define class "java" in package suncertify.db.Data - this means to not use Java Code Conventions.

c)more like, having a class named Data in package 'suncertify.db' and this class has a static inner class named 'java'

The difference between b) and c) is that the last one really defined that class in the specified package 'suncertify.db'.

Bot b) and c) means loosing some credits. But to not defined class Data.java (in a file named Data.java, of course) means failing the assignment.

Of course, I could send an email to who2contact@sun.com to ask about it but is possible that I do not receive an answer.

Please, comment this.

Regards,
Catalin Mihalache

SCJP, SCWCD, SCDJWS
 
Kah Tang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What they mean is that you need a class named Data in a package called suncertify.db and have the source file called Data.java. It wouldn't really make sense to have a class called java.
 
Catalin Mihalache
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kah Tang,

Logically, you are right - there is meaning in naming a class 'java'. But SCJD assignment request is very clear: a class named 'Data.java' in package suncertify.db. There is not class named 'Data' but 'Data.java'. And I remember that not respecting a MUST means automatic failure.

My solution is something like :

package suncertify.db;

public class Data {
public static class java {
}
}

I know, is stupid, but it respects a MUST from SCJD assignment.

Regards,
Catalin Mihalache
SCJP, SCWCD, SCDJWS
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seriously, just make a class which is called "Data" inside a package called "suncertify.db" and you'll be fine.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic