Beginner - class & main method question

Hello, I am still really new to OOP and Java. I came across an example in the book I am using that threw me for a loop.
ex.
class MyClass {
public static void main(String [] args) {
int x = 42;
MyClass y = new MyClass();
int z = y.go(x);
int go(int arg) {
arg = arg * 2;
return arg;
what I am confused about is the creation of a new class that contains the main method (MyClass y = new MyClass()), wouldn't this create a new class that also has a main method? Or is this the kind of code I will never encounter outside an example in a book and shouldn't worry about it :-)
Thanks

Since the main method is static, it would be invoked through MyClass.main(...). Note that this is not actually creating an object, just calling a static method.
Creating an object is an entirely different story. MyClass mc = new MyClass(); instantiates a new object of the class MyClass. You couldn't do mc.main(...) because main is static. You can call things such as mc's go() method because they are not static and thus belong to objects of that class, rather than the class itself.
...Or something. That all made sense in my head, but if it didn't make sense to you just tell me.

Similar Messages

  • Main method question in java, please help

    Guys I have looked all over the internet, and cannot understand any of these questions: I would really appreciate any help on them. The first, and most important thing I would like to know is, what is static: what is a static int, or a static main method? Why is this necessary, and what does it do? Could you please provide an example? Also, why is String[] args necessary within the parameters of the main method? Is this so that it can execute it? Last thing is: objects. Where can I learn about them? I know they are made with the new operator, but don't understand their use? Could you explain why they are useful? Can you give them values? and how do they relate to the dot operator? After these are answered, I will be so happy because I will feel like I actually know a little bit. Right now, I'm just confused... Thank you so, so much in advance!

    The first, and most important thing I would like to know is, what is static'static' means that the item concerned is associated with the class itself rather than an instance: so, it is accessible to all instances.
    Could you please provide an example?
    public static void main(String[] args)is an example, but you knew that. I don't really understand the question.
    Also, why is String[] args necessary within the parameters of the main method?'args' receives the arguments you type on the command line after the class name or jar name, depending on how you invoke the application.
    This is all covered in the documentation, which you should read before asking further questions.
    Last thing is: objects. Where can I learn about them?If you don't know about objects you're not going to learn about them by asking questions on a forum. It's far too large a topic. Get yourself a book.

  • Java programming language main method question?

    Hello everyone I am quite new to the Java programming language and I have a question here concerning my main method. As you can see I am calling 4 others methods with my main method. What does the null mean after I call the method? I really don't understand is significance, what else could go there besides null?
    public static void main(String[] args)
              int cansPerPack = 6;
              System.out.println(cansPerPack);
              int cansPerCrate = 4* cansPerPack;
              System.out.println(cansPerCrate);
              have_fun(null);
              user_input(null);
              more_java(null);
              string_work(null);
         }Edited by: phantomswordsmen on Jul 25, 2010 4:29 PM

    phantomswordsmen wrote:
    ..As you can see I am calling 4 others methods with my main method. 'Your' main method? Your questions indicate that you did not write the code, who did?
    ..What does the null mean after I call the method?.. 'null' is being passed as an argument to the method, so there is no 'after the method' about it.
    ..I really don't understand is significance, what else could go there besides null? That would depend on the method signatures that are not shown in the code snippet posted. This is one of many reasons that I recommend people to post an SSCCE *(<- link).*
    BTW - method names like have_fun() do not follow the common nomenclature, and are not good code for a newbie to study. The code should be put to the pointy end of your sword.

  • Classes and Methods question

    Hi
    I have a class called Users that i would like to use .... well to store users in the db, i would like to be able to call form the servlet:
    users.addUser(user); or users.deleteUser etc ...
    My question is:
    Do i need a new class eg. addUser that implements TransactionWorker for each method? Or can I do that directly from a method call?
    Regards
    ALex

    HI Alex,
    If you are storing a single record, normally you don't need to use a TransactionWorker, since auto-commit will be used implicitly.
    If you are storing multiple records per transaction, then the TransactionWorker will be at a higher level and will call multiple methods to add/modify/delete records.
    In any case, a TransactionWorker class per method is not normally the right approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Calling Classes main method

    I have two classes, I want to create a new instance of Class B and run it's main method...not sure if I'm being clear. Any help is greatly appreciated :)

    Actually, I have Class A that sends an email with an attachment, copies the File into another folder (backup), and deletes the old file. Class B deletes all backed-up files with a last modified greater than 30 days. I wish to run Class B's main method from Class A....somewhat of a method call (main method).
    Do I just have to import the DeleteFile and create a new instance of DeleteFile? I'm just getting back into the swing of java and have forgotten :)
    Also, do you know how to place a timer around a Delete method? I'm calling the following methods in a row, but my Delete method will only delete on the very first iteration....although the Copy, SendEnrollMail works properly everytime...hmmmm? I've looked throughout support, but cannot find exactly what I'm looking for.
    // Import packages/classes
    import IKEvent;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.text.*;
    // Class declaration
    class StringToken{
    // Static method called from main method - can't instantiate
    public static void copyFile(String aOldFile, String aNewFile, String aAttachment)throws IOException{
    // Local variables
    String oldFile = aOldFile;
    String newFile = aNewFile;
    String attachment = aAttachment;
    String currentDate = "";
    // Instantiate a Date object
    Date myDate = new Date();
    // Convert myDate(long) to String
    currentDate = myDate.toString();
    // Format currentDate variable
    SimpleDateFormat format = new SimpleDateFormat("dd_MM_yyyy");
    currentDate = format.format(new Date());
    // Copy instructor report
    File inputFile = new File(oldFile);
    File outputFile = new File(newFile + currentDate + "_" + attachment);
    FileInputStream in = new FileInputStream(inputFile);
    FileOutputStream out = new FileOutputStream(outputFile);
    int c;
    while ((c = in.read()) != -1)
    out.write(c);
    in.close();
    out.close();
    // Static method called from main method - can't instantiate
    public static void deleteFile(File aDeletedFile)throws IOException{
    // Local variables
    File delFile = aDeletedFile;
    // Delete the instructor report
    delFile.delete();
    // sendEnrollMail method
    public static boolean sendEnrollMail(String aSmtpServer, String anEmail, String aFirstName, String aLastName, String logFile, String ccAddress, String aCourseSession, String aFileName, String aReportDir)throws IOException{
    // Local variables
    Properties props = System.getProperties();
    String mailServer = aSmtpServer;
    String crseSession = aCourseSession;
    String emailAddress = anEmail;
    String firstName = aFirstName;
    String lastName = aLastName;
    String filename = aFileName;
    String reportDir = aReportDir;
    // Begin error checking
    try{
    // SMTP protocol, relays message to the SMTP server of the recipient(s)
    // eventually to be acquired by the user(s) through POP or IMAP
    props.put ("mail.smtp.host", mailServer);
    // Instantiate a basic mail session object, uses java.util.Properties
    Session emailsession = Session.getDefaultInstance(props, null);
    // Create a message, pass along the session object to the MimeMessage constructor
    Message email = new MimeMessage(emailsession);
    // Set from of email - administration
    InternetAddress fromAddress = new InternetAddress(ccAddress, "Name");
    email.setFrom(fromAddress);
    // Set recipient(s) of email
    InternetAddress[] address = {new InternetAddress(emailAddress), new InternetAddress(ccAddress)};
    email.setRecipients(Message.RecipientType.TO, address);
    // Set subject/date
    email.setSubject("Evaluations Results Report for Session " + crseSession);
    email.setSentDate(new Date());
    // Fill the message
    StringBuffer welcomeMessage = new StringBuffer();
    welcomeMessage.append("Hi ").append(firstName + " " + lastName + ":"+'\n'+'\n');
    welcomeMessage.append("The Evaluations Results Report for Session " + crseSession + " has been attached to this email. If you have any problems accessing the file, please contact aName at there-email."+'\n'+'\n');
    // Creation of message part
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(welcomeMessage.toString());
    // Create a multipart
    Multipart multipart = new MimeMultipart();
    // Part one is inputting the text of the message
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    // Create second body part, attachment
    messageBodyPart = new MimeBodyPart();
    // Get the attachment
    DataSource source = new FileDataSource(reportDir + filename);
    // Set the data handler to the attachment
    messageBodyPart.setDataHandler(new DataHandler(source));
    // Set the filename
    messageBodyPart.setFileName(filename);
    // Add part two
    multipart.addBodyPart(messageBodyPart);
    // Put parts in message
    email.setContent(multipart);
    // Send the message
    Transport.send(email);
    // Append the log file with success
    FileOutputStream fout = new FileOutputStream ( logFile , true );
    PrintStream pout = new PrintStream (fout);
    // Log a successful email
    pout.println ('\r');
    pout.println (new java.util.Date() + " - Send Enroll Email Successful!");
    pout.println ("email: " + emailAddress);
    pout.println ("first name: " + firstName);
    pout.println ("last name: " + lastName);
    pout.close();
    // End of error checking for sendEnrollMail function
    catch (MessagingException e) {
    // Append the log file with failure
    FileOutputStream fout = new FileOutputStream ( logFile , true );
    PrintStream pout = new PrintStream (fout);
    // Print message to log upon failure
    pout.println ('\r');
    pout.println (new java.util.Date() + " - Send Enroll Email Failure!");
    pout.println ("email: " + emailAddress);
    pout.println ("first name: " + firstName);
    pout.println ("last name: " + lastName);
    pout.close();
    return false;
    Thank you!

  • Calling main method in another class using command line arguements

    Hi
    My program need to use 4 strings command line arguments
    entered in Project properties/Run/Application Parameters
    java programming for beginners // arguments
    The program needs to call main in the second class 4 times using argument 1 the first call, argument 2 the second call on so on.
    So the output wil be
    java
    programming
    for
    beginners
    import java.lang.*;
    public class First extends Second{
      public static void main(String[] args) {
        for(int i = 0; i < args.length; i++){
           Second.main(args); // Error I think
    import java.lang.*;
    public class Second {
    public static void main(String[] args){
    System.out.println(args[0]);
    "First.java": Error #: 300 : method main(java.lang.String) not found in class Second at line 6, column 15
    I am only a beginner with little knowledge of java so can the code be as basic as possible

    Your style looks quite bad for starters..... Hows
    this://import java.lang.*; /* NOT NEEDED */
    public class First extends Second{
    public First(String s) {
    super(s);
    public static void main(String[] args) {
    for(int i = 0; i < args.length; i++){
    new First(s);
    public class Second {
    public Second(String s)
    System.out.println(s);
    NOT NEEDED:
    public static void main(String[] args){
    System.out.println(args[0]);
    }My question to you: Do you understand why my code
    works? (does it do what you want?)I think since this is some kind of lesson, the OP have to implement some way to use the main method of the Second class as it is, that is, with String[] args. I think this lesson is interesting exactly because of this requirenment. But, anyway, I don�t know, that is just my assumption...

  • How do you call a java class from the main method in another class?

    Hi all,
    How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
    Thanks
    SI
    Edited by: okun on May 16, 2010 8:40 PM
    Edited by: okun on May 16, 2010 8:41 PM
    Edited by: okun on May 16, 2010 8:47 PM

    georgemc wrote:
    To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern.

  • Calling main method of a class

    Hi
    I have to call the Main method of a class in some other class becuass that class is accepting command line aurguments.
    I test it and everything is working fine.
               String[] strings = new String[3];
               strings[0] = "E:/practice.cap";
               strings[1] = "-o";
               strings[2] = "E:/practice.txt";
               Main.main(strings);I now want to know is there any drawback of doing this ?
    BR
    regards

    Muhammad Umer wrote:
    Good Explanation. But my question is not to explain the importance of main method in classes :)As far as the Java language and APIs go, there's nothing wrong with calling main just like any other method, because it is just another method. It's only special to the JVM, and to programmers who assume that it's the entry point to the program.
    As far as Java is concerned, you can call as many mains as you want. The only potential problem arises if some particular main is written in a way that relies on it being the entry point to the whole program. That is, if the author wrote it with the assumption that it would only be called by the JVM at startup time, and would not be called arbitrarily from within your code (EDIT: and if proper behavior relies on that assumption being upheld). However, this is just a particular case of a general issue that we always have to be aware of, namely, make sure you understand how a method is intended to be used, and use it in that fashion, or accept the consequences.
    EDIT: However, having said that, it's unusual to call main explicitly, so if you can, I would suggest pulling the functionality that you want out of that main into a different method, and then both your code and the main can call that method. If you cannot do that, then at the point where you call main, clearly document why you're doing it. Otherwise, whoever reads the code a few months or years from now--maybe somebody else, maybe you--will be wondering if the programmer really knew what he was doing, or if that is a mistake. That kind of second-guessing is the source of a lot of maintenance nightmares.
    Edited by: jverd on Nov 3, 2011 8:43 AM

  • Renaming main method class.

    When compiling my java classes, I find that they are always compiled
    to a file name of X.class.
    If I only ever want to rename one class file, the class file with my main method
    inside it, and have
    java NewClassName.newExtention
    run it as per normal, may I do that, and how do I have it run?
    What may I specify in an executable jar file's manifest main-class entry to have this work as well?

    I use a free jar wrapper tool, that for reasons I won't go into I'm locked into.
    It mentions the main-class manifest entry, and so the main class .class name,
    in plain text in the result wrapped file unfortunately.
    Which after some research isn't too much of a problem, since
    I can't access method or constructor class innards with reflection;
    since the default class loader will only get me as far as a class reference.
    Correct?
    So my only question is...
    Java Class Loading.

  • Question of the day: In which Thread context does the main method run ?

    let's say, you create a JFrame in the main method:
    public static void main(String[] args)
    new MyJFrame();
    let's suppose, you construct the whole JFrame
    inside the constructor, which contains a lot
    of other Swing components, like JTree's and more.
    AND the JFrame calls setVisible(true) in its
    constructor.
    -> According to my knowledge, this won't work
    properly - it will function, BUT you will get one
    or two quite big exceptions (which usually start
    with a nullpointer exception, produced by the
    PLAF, but the whole stacktrace shows, that the
    the exception was thrown AND catched inside
    the Swing objects.
    Reason for this would be, that all operations
    after the "setVisible(true)" statement must be
    carried out in the eventdispatch thread, according
    to Swing rules.
    Now, as you can see by running the source below,
    the main() method always is processed in special thread,
    NOT the event dispatch thread - which produces the above behaviour.
    My Question:
    Wouldn't it have been easier to let the JVM
    process the main() methods right in the
    event dispatch thread ?
    Or:
    Why is the JVM designed to process the
    main() method in a special thread and not
    the Swing event dispatch thread ?
    opinions?
    Regards
    JPlaz / SnowRaver
    package Test1;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame
    public Frame1( final String title, int position )
    this.setSize(400,300);
    this.setLocation(position,position);
    this.setVisible(true);
    if( SwingUtilities.isEventDispatchThread() )
    System.out.println("Constructor of "+title+" is processed IN the event dispatch thread.");
    else
    System.out.println("Constructor of "+title+" is processed in ANOTHER than the event dispatch thread.");
    public static void main(String[] args)
    // First creation just from the startup thread context :
    new Frame1("first Frame", 60);
    // Now we let the second creation be done in the
    // eventdispatch thread context for sure :
    SwingUtilities.invokeLater( new Runnable()
    public void run()
    new Frame1("second Frame",120);

    Matt,
    it's been so long, I don't have the full answer in my head.
    This page on Adobe.com has an example that shows Flash 4
    mouse stuff (I'm Mr
    Vague today) when you scroll down. Your timelinme reference
    will be
    something like
    TellTarget(_Root, gotoAndPlay(50))
    Hopefully from that vagueness you can locate the right
    answer.
    Steve
    Adobe Community Expert: Authorware, Flash Mobile and Devices
    My blog -
    http://stevehoward.blogspot.com/
    Authorware tips -
    http://www.tomorrows-key.com

  • Main method in mulitple classes?

    I'm new to java as some of you might know, and I've been working on a single class. Now I'm trying to add another class. I've tried many ways to do this, and I think I almost have it, but I'm still a little stuck. Here are a few questions:
    1. I only can have one main method, which goes in the main class, right? Then the subclasses just have methods? So, how does the subclass know which methods to call first, and when? If there is a main method in the subclasses, t should be private and the main method in the main class should be public? So if I have multiple methods in a subclass, how do I tell my main method which to call? I've tried:
    new Timer.test();
    new Timer(test);Neither seem to work.
    So, organized in a tree it should be like so:
    Public class mainClass
         public main method
              new subClass
      Private class subClass
          (no main method?)
              private subClassMethod1
              private subClassMethod2I've tried searching, but maybe I'm not searching for the right terms. I can find things on creating classes and methods, but not really on the way multiple classes are set up. Can someone explain so I understand exactly what I'm doing with multiple classes, or give me a link to a good explanation? Thanks
    Also, the subclass ALWAYS extends mainClass right?
    Edited by: LIVE3A17 on Apr 28, 2009 3:13 PM

    LIVE3A17 wrote:
    Ok, so I can use main methods in the other classes, and java knows which is the main class by which one is opened when the program is run. Got it. Don't even put a main method in the other classes, unless you intend on one of them to be an entry point. Otherwise it's just code bloat.
    >
    Now, I have a main method in both classes. When I have the main method in the main class set to public, I get an error in the second class saying "Cannot reduce the visiblity of the inherited method". I gives me the option to change visibilty of my main class to private. However, when I do this, and try to run the main class, I get an error saying main method not public.I don't know what you're talking about. Sounds like you are subclassing something and for whatever reason trying to 'override' the main method. The normal static main method isn't even inherited, being static. So this error you're speaking of doesn't make much sense. Of course without seeing your code, we're left to mindreading exercises which usually don't go so well.

  • How can i call a main method  from a different class???

    Plzz help...
    i have 2 classes.., T1 and T2.. Tt2 is a class with a main method....i want to call the main method in T2......fromT1..is it possibl..plz help

    T2.main(args);

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
    Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ifelse_Statement
        class Program
            static void Main(string[] args);
            TestIfElse(10);
            public static void TestIfElse(int n);
            if(n < 10)
                     Console.WriteLine("n is less than 10");
             else if(n < 20)
                    Console.WriteLine("n is less than 20");
             else if(n < 30)
                Console. WriteLine("n is greater than or equal to 30");
    Here is the error list I am getting,
    Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 13
    switch_Statement
    Error 2
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 24
    switch_Statement
    Error 3
    Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 9
    ifelse_Statement
    Error 4
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 20
    ifelse_Statement
    Error 5
    Invalid token 'if' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 9
    ifelse_Statement
    Error 6
    Invalid token '10' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 7
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 8
    Invalid token '(' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    18 35
    ifelse_Statement
    Error 9
    A namespace cannot directly contain members such as fields or methods
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    20 10
    ifelse_Statement
    Error 10
    Type or namespace definition, or end-of-file expected
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    30 1
    ifelse_Statement
    Error 11
    The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    16 12
    ifelse_Statement
    Error 12
    'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    18 26
    ifelse_Statement

    static void Main(string[] args){
    TestIfElse(10);
    public static void TestIfElse(int n)
    if (n < 10)
    Console.WriteLine("n is less than 10");
    else if (n < 20)
    Console.WriteLine("n is less than 20");
    else if (n < 30)
    Console.WriteLine("n is greater than or equal to 30");
    Fouad Roumieh

  • Class extending a Frame with main method in it - how do I use the methods?

    Howdy.
    Having a problem.. I want my "main" class, ie. the class with the main method in it to extend a Frame class.. because the main method is static, I can't use Frame's methods.
    What's a trick to get around this ? I am making a deliberate design decision to extend the Frame class, because I thought it was.. well.. better. I could always just create a Frame object and utilise it.. but from little things I've read and seen it's better to extend it.
    When I use Forte to make a Frame program it sets up a constructor/etc. for the main class and then it does something akin to this (the class is called MazeGenerator) :
    public static void main(String args[]) {
    new MazeGenerator().show();
    What does "new MazeGenerator().show();" do when it's not being associated to an object handle ??
    Ta.
    - Scutt.

    Create an instance of the frame in main then the constructor can control it. Or you could add an init method or something:
    class MyFrame extends Frame {
    public static void main (String [] args) {
    MyFrame frame = new MyFrame();
    frame.init();
    You don't necessarily have to have a reference to an Object in order to create one. All the work can be done in the constructor (something I'm not really fond of however)

  • Adding a class to a project in sunone studio that already has a main method

    i have a frame class and it contains a main method, I can't figure out how to add a class that makes use of the JDialog and call it from the main class. When i try to add a JDialog, it creates its own main method.
    If abc.class is my main method class and dcf.class is my class that makes the dialog GUI, I want abc.class to be able to call it, i can't figure out how to do this in Sun One Studio 5

    Having a main() in the JDialog doesn't hurt. It lets you run the JDialog as a standalone - make sure that it looks good, etc. When you run your other class, the main() won't get called. (And you can delete it when you're all debugged.
    Alternatively, create a new class, then start it by saying
    class MyDialog extends JDialog {
    }S1S will be completely happy if you do it that way.

Maybe you are looking for

  • Scroll is not working properly in safari 5.1 in window as well as Mac PC.

    Anybody have solutions ?? I have a jsp page that renedering data dynamically using DWR (Ajax calling). but at the end scroll bar isn't loading all the data in whole page.so i can't see the data at bottom level but. when i click anywhere or just refre

  • Startx: X server runs for split second, then dumps me back to shell

    I'm trying to install an X server on a newly installed Arch Linux VirtualBox guest machine, but when I type "startx", the X server only runs for a split second, and then dumps me back to the shell. Here are my ~/.xinitrc and /var/log/Xorg.0.log files

  • Installation fails Photoshop CS6 Public beta 64bit windows 7

    I tried to install the windows version of Photoshop CS6 Public Beta, the 64bit version failed to install said that it failed to locate folder tokens. I uninstalled it and restart my computer. I tried to reinstall but I still get the same error. What

  • Oracle Database Design Courses?

    Hi, I was searching around the Oracle website looking for some Database Design courses, couldn't find anything. Anyone know if this type of course is available, if not through Oracle then with some other company? TIA, Rick.

  • Blocking a certain e-mail address?

    Hi, this probably has been asked before ... but how do I block a certain e-mail address that keeps sending spam (always using the same address) on my mail server? Preventing these mails to enter the mail queue would be optimal ... they seem to slow d