Add numbers in array without adding adjacent number
Your indentation is inconsistent, and it looks like you got confused yourself, since you are computing and printing "real sum" many times.

The code organization could use improvement as well.  The valueadd() function does a lot of stuff:


Populating the array with random members
Printing the array
Summing the array using streams, and printing that sum
Summing the array by working from the ends towards the middle, and printing that sum


There is no way to figure out what it does without reading all of the code.  Ideally, each function should be limited to a single responsibility.

There are a lot of instance variables, all cryptically named, and all public:


public int a;
public int b[];
public int sum=0;
public int sum1=0;
public int k=0;
public int m=0;



Only the array should be an instance variable here; all of the others could be local variables.

The output looks a bit sloppy as well.  For example, I would expect there to be a newline after printing the array contents, and a space after "real sum".

Suggested solution

Notice how each method has a one-sentence JavaDoc summary of what it does.  (If you can't write such a summary for a function, then it would be an indication that the function is poorly designed.)

import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class ArrayAdder {
    private int[] array;

    /**
     * Randomly populates an array of integers of the specified size.
     */
    public ArrayAdder(int size) {
        this.array = new int[size];
        for (int i = 0; i &lt; size; i++) {
            this.array[i] = (int)(9 * Math.random());
        }
    }

    /**
     * The elements of the array, delimited by spaces.
     */
    public String toString() {
        return IntStream.of(this.array)
                        .mapToObj(String::valueOf)
                        .collect(Collectors.joining(" "));
    }

    /**
     * Sums the array using IntStream.
     */
    public int streamSum() {
        return IntStream.of(this.array).sum();
    }

    /**
     * Sums the array by working from the ends toward the middle.
     */
    public int nestedSum() {
        int i, j, sum = 0;
        for (i = 0, j = this.array.length - 1; i &lt; j; i++, j--) {
            sum += this.array[i] + this.array[j];
        }
        if (i == j) {
            sum += this.array[i];
        }
        return sum;
    }

    /**
     * Demonstrates the equivalence of two addition methods on a 5-element array.
     */
    public static void main(String[] args) {
        ArrayAdder demo = new ArrayAdder(5);
        System.out.println(demo);
        System.out.println("Sum using stream: " + demo.streamSum());
        System.out.println("Nested sum: " + demo.nestedSum());
    }
}