kishore srimat

Greenhorn
+ Follow
since Dec 18, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kishore srimat

The program before the stars was my program and my prof gave this template and i wrote in normal static user input from the program not interatively at runtime when program starts i want to give the input and get the output and i am breaking my head i need to use args
16 years ago
import java.util.*;

public class StringReverseWord {

private static void doStringReverseWord() {

String a = " Rohit Khariwal Mohit Parnami";
Stack stack = new Stack();

// this statement will break the string into the words which are separated by space.
StringTokenizer tempStringTokenizer = new StringTokenizer(a);

// push all the words to the stack one by one
while (tempStringTokenizer.hasMoreTokens()) {
stack.push(tempStringTokenizer.nextElement());
}

System.out.println("\nOriginal string: " + a);

System.out.print("Reverse string: ");

// pop the words from the stack
while(!stack.empty()) {
System.out.print(stack.pop());
System.out.print(" ");
}

System.out.println("\n");
}


public static void main(String[] args) {
doStringReverseWord();
}

}

*********************************************
i want to do somethig like this template
*********************************************
public class Reverser {
public static String reverse(char[] original) {
// Implement this method.
}

public static void main(String[] args) {
System.out.println("Original: " + args[0]);
System.out.println("Reversed: " + reverse(args[0].toCharArray()));
}
}
16 years ago
int[] a = new int[10];

one object here

int[][] b = new int[10][10];

But here i am not sure whether it creats 10 objects ? or again one object

16 years ago
int[] a = new int[10];
int[][] b = new int[10][10];
16 years ago