Tag Archives: java

1,204 views

Unchecked call to add(E) as a member of raw type java.util.List

// warnning private List list = new ArrayList();   // ok /put type of added object private List<String> list = new ArrayList<String>();

Posted in Bugs, warnings, errors | Tagged , | Comments Off on Unchecked call to add(E) as a member of raw type java.util.List
5,607 views

ArrayList Sublist Join Compare Loop Synchronize HashMap Sort Tree

Link to tutorial ArrayList Sublist of ArrayList Join two ArrayList Compare ArrayList Initialize ArrayList Loop ArrayList Sort ArrayList Array to ArrayList ArrayList to Array Synchronize ArrayList Serialize ArrayList LinkedList Loop LinkedList Vector ArrayList vs Vector ArrayList vs LinkedList HashMap Loop … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on ArrayList Sublist Join Compare Loop Synchronize HashMap Sort Tree
7,369 views

Difference between logical operators and or Java

Basic difference remember it!!! if(TRUE && TRUE && TRUE) return TRUE otherwise FALSE if(FALSE || FALSE || FALSE) return FALSE otherwise TRUE Logical operator and && If all conditions/operands is TRUE return TRUE, otherwise return FALSE if( true and true … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Difference between logical operators and or Java
2,378 views

Windows set Environment Variables – Java path

How set JAVA path to Environment Variables on Windows (7) Select Start menu > Computer > System Properties > Advanced System Settings(properties). Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your … Continue reading

Posted in Eclipse | Tagged | Comments Off on Windows set Environment Variables – Java path
2,429 views

Java Basic Rules

// file name MyFirstClass.java   import java.util.*; import java.lang.Math; import java.io.*; import javax.swing.*;   public class MyFirstClass{ // start of program public static void main(String[] args) { // basic function main   // variables and calculation int a=2; int b=3; … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , | Comments Off on Java Basic Rules
4,405 views

String Array of Array Java Example

Set, get string , array of array of strings, Java example code public final static String[][]_arArOfString_1 = { new String[] {"bla","bla","hello world!"}, new String[] {}, new String[] {}, new String[] {}, new String[] {}, new String[] {} }; String sOut … Continue reading

Posted in Android Examples Code, Array,List,Collections | Tagged , , | Comments Off on String Array of Array Java Example
2,416 views

Two boolean as one parameter value in function Java

boolean fc(boolean b) { return b; }// end fc boolean bA = true; boolean bB = true; boolean bC = bA || bB; // true   bA = true; bB = false; bC = bA || bB; // true   … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Two boolean as one parameter value in function Java
3,443 views

Replace graphic accent diacritic Java Function

Replace diacritic marks: Á Č Ď É Ě Í Ň Ó Ř Š Ť Ú Ů Ý Ž á č ď é ě í ň ó ř š ť ú ů ý ž public String replaceDiacritic (String inputStr) {   … Continue reading

Posted in Android Examples Code | Tagged | Comments Off on Replace graphic accent diacritic Java Function
2,150 views

goto statement in Java

You can use for, do while, while cycle for example: public void myFunction(){ for (int i = 0; i < 1; i++) { // some code int c = 10; if(c==10) break; // goto stop; in C++ } // end … Continue reading

Posted in Android Examples Code | Tagged | Comments Off on goto statement in Java
4,257 views

Date getDate is deprecated Java Android

Date getDate is deprecated Java Android example code:   long dayInMili = 100000000;   GregorianCalendar calToDay = new GregorianCalendar(); int nD = calToDay.get((Calendar.MILLISECOND)); // +dayInMili; System.out.println(nD);   long lTime = calToDay.getTimeInMillis(); System.out.println(lTime);   Date dtA = new Date(lTime); // today … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Date getDate is deprecated Java Android