Friday, 27 December 2013

Important things in Java


int [] A = new int [n];
for (int x : A) System.out.println (x);

int[] array = new int[4];
Arrays.fill(array, 0);

System.out.println(Arrays.deepToString(array));

Math.max (a, b)
Math.abs (a)

StringBuilder:
StringBuilder res = new StringBuilder ();
res.append (char ('A'));
res.append (String);
String ans = res.toString();

int[] array = new int[4];
Arrays.fill(array, 0);


Arrays.Sort (object[], startIndex, endIndex);

Set st = new HashSet  ();
st.add (5);
st.size();

List  list = new ArrayList  ();
Concerting Set to List type
List  list = new ArrayList  (st);
Collection.sort (list);

String s = new String();
s.toCharArray();

Input Output Code in Java (Code is taken from Egor's library).



-------------------------------------------------------------------------------------------
If you want to use something other, this is Parser class for input (Written by Rudradevbasak's team proof). For output, you can use PrintWriter class which is fast enough.






























No comments:

Post a Comment