Skip to main content

JDK Vs JRE

JDK = JRE + Java Development tools
JRE = JVM + Java inbuilt packages + Run time libraries

Most of the people always has the doubt of why JDK is again having JRE inside ? Though it got provided out of the JDK.

Standard JRE doesn't have tools like javac, javaDB and tool.jar
So make sure you always point JDK JRE in your project build path.

Except the above difference rest of the things are same with Standard JRE's and JRE inside JDK.



Comments

Popular posts from this blog

NO SQL Types and vendors in market

NO SQL

KEY - VALUE Store  - Similar to a  MAP.
   e.g. Dynamo DB or REDIS

DOCUMENT Sore  - Similar to KEY-VALUE, value can be JSON/XML and key will be unqiuely idnetified this document.
   e.g. Coutch DB or mongoDB.

Column Store - Multi timentional table, identifying data with row and column numbers.
  e.g.  Cassandra or Apache HBase

Graph Store - Store relation between nodes (record entities). It has better transaction management
e.g. Neo4J and Orient DB.




Compress a String

package com.sbs.java8.praticse;

public class StringCompression {

public StringCompression() {
// TODO Auto-generated constructor stub
}

public static void main(String[] args) {
System.out.println(compressString("aaaabbbbbccccAAAAccccccccdefg"));
}

public static String compressString(String str) {
//String str = "aaaabbbbbcccc";
char[] charArray = str.toCharArray();
String compressedString = "";
int i = 0;
while (i < charArray.length) { int counter = 1; int j = i + 1; while (j < charArray.length && charArray[i] == charArray[j]) { counter++; j++; i++; } compressedString = compressedString + charArray[i] + counter; i++; } //System.out.println(compressedString); String output =(compressedString.length() > charArray.length)? str: compressedString;
return output;
}
}