Printing a Φ pattern using * characters
Your use of the temp variable makes your code particularly infuriating to follow:


It's not even that temporary in scope: it's used throughout the function!
temp is almost never a good name for a variable, since it doesn't give any clue what it is supposed to represent.
You redefine and repurpose it several times within the function.
There are too many if(num%2==0) special cases.  You shouldn't need any special cases if you just use the truncation that naturally happens with integer division in your favour.


For that matter, num is also a meaningless variable name.  I can see that it's an int, which is, obviously, a number.  How about size instead?

There's a lot of copy-and-paste code.  You could benefit greatly splitting the work into functions.  Decomposing the task would also force you to think about what the subroutines are, and help you organize your code.

Calling System.out.print() to print each character at a time is very tedious.  It's also bad for performance, if that matters to you.  A much better strategy would be to create a buffer to print at least a line at a time, if not the entire picture at once.  Another benefit of using a buffer is that you can just place the stars in the right place using a formula.

Suggested solution

import java.util.Arrays;

public class Phi {
    /**
     * Produces a string of spaces that has the character &lt;code&gt;c&lt;/code&gt;
     * at the three specified indices, followed by a newline.
     */
    private static String row(char c, int left, int mid, int right) {
        char[] line = new char[right + 2];
        Arrays.fill(line, ' ');
        line[left] = line[mid] = line[right] = c;
        line[right + 1] = '\n';
        return new String(line);
    }

    public static String toString(char c, int size) {
        StringBuilder out = new StringBuilder();
        int halfWidth = (size + 1) / 2;

        // Top stem
        out.append(row(c, halfWidth, halfWidth, halfWidth));

        // Body
        for (int row = 2; row &lt;= size / 2; row++) {
            out.append(row(c, halfWidth - row, halfWidth, halfWidth + row));
        }
        for (int row = halfWidth; row &gt;= 2; row--) {
            out.append(row(c, halfWidth - row, halfWidth, halfWidth + row));
        }

        // Bottom stem
        out.append(row(c, halfWidth, halfWidth, halfWidth));

        return out.toString();
    }

    public static void main(String[] args) {
        int size = Integer.parseInt(args[0]);
        System.out.printf("\nNumber = %d\n%s", size, toString('*', size));
    }
}