aspose file tools*
The moose likes Beginning Java and the fly likes Syntax problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Syntax problem" Watch "Syntax problem" New topic
Author

Syntax problem

Eddy Ades
Greenhorn

Joined: Nov 14, 2005
Posts: 12
I have a class (name Journee (means Day)
Now I'm trying to say in class method and my instances method
if they select Saturday or Sunday this means weekend

and in my other method I have to say if it's not Saturday or sunday then it equald a weekday.

The main problem that I have, is I have no idea how to code this.
I tried couple thing, but I'm looking (probably at the wrong place) I would really appreciate some help
I tried writing a few stuff but it dosen't hurt !!

here what I have so far ( it's all in french tough!!)


public class Journee {

// Cette classe contient l'information sur le jour de la semaine inscrit

// variable(s) de classe s'il y a lieu
final public static String Lundi = "lu";
final public static String Mardi = "ma";
final public static String Mercredi = "me";
final public static String Jeudi = "ju";
final public static String Vendredi = "ve";
final public static String Samedi = "sa";
final public static String Dimanche = "di";
public String Journee;

// variable(s) d'instance s'il y a lieu
private String jourDeLaSemaine;

// constructeur(s) s'il y a lieu
public Journee (String jourDeLaSemaine){
Journee = new String ();
}
// m�thode(s) de classe s'il y a lieu
// Permet de v�rifier si le jour de la semaine entr�e est Sa ou Di
public boolean equals (Journee j1){
boolean result;
if(this.jourDeLaSemaine ==j1.jourDeLaSemaine){
result;

// m�thode(s) d'instance s'il y a lieu
public boolean equals (Journee j2){
boolean result;
if(this.jourDeLaSemaine ==j2.jourDeLaSemaine){

} // Journee



thanks
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
You can have a method called isWeekend which returns a boolean.

In the method, you can return true if the day is satur or sun.


ASCII silly question, Get a silly ANSI.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Syntax problem