Tag Archives: statement

5,673 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
9,530 views

Goto labeled statement in Java example

Goto in for cycle Java example source code. MainClass.java public class MainClass { public static void main(String[] arg) { String[] arrayOfString = {"nothing", "Hello", "people" , "bye-bye", "hello", "world!", "end" };   OuterLoop: for (int i = 0;i<6; i++) { … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Goto labeled statement in Java example
6,660 views

break statement in Java Android example

break statement in Java Android basic example MainClass.java public class MainClass { public static void main(String[] arg) { String[] arrayOfString = {"nothing", "Hello", "people" , "bye-bye", "hello", "world!", "end" };   for (int i = 0; i < arrayOfString.length; i++) … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on break statement in Java Android example
32,296 views

If, else if, else statement Java Android example

if , else if, else statement with string as a switch statement in Java example source code. MainClass.java public class MainClass { public static void main(String[] arg) { String[] arrayOfString = {"nothing", "Hello", "people" , "bye-bye", "hello", "world!", "end" }; … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on If, else if, else statement Java Android example
2,302 views

The Labeled continue statement Java example

The Labeled continue statement as goto Java example. public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" }; OuterLoop: for (int e = 0; e < 4; e++) { for (int … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on The Labeled continue statement Java example
2,690 views

Continue statement Java example

For and continue statement in Java. public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" };   for (int i = 0; i < arrayOfString.length; i++){ if(arrayOfString[i].equals("hello")) continue; // skip to … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Continue statement Java example
6,382 views

do while cycle Java basic example

do while Java example public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" }; int i = 0; // first cycle is always executed do { System.out.println("Loop: " + i); System.out.println(arrayOfString[i]); … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on do while cycle Java basic example
2,047 views

While cycle loop in Java example

While cycle Java basic example with array of strings. MainClass.java public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" }; int i = 0; while ( i < arrayOfString.length ){ System.out.println(arrayOfString[i]); … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on While cycle loop in Java example
3,591 views

For cycle loop in Java example

Cycle for in Java example public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" };   for (int i = 0; // start position , first cycle i == 0 i … Continue reading

Posted in Android Examples Code | Tagged , , , , , , , | Comments Off on For cycle loop in Java example
20,647 views

Foreach loop cycle in Java Android example

Foreach in Java basic example source code. MainClass.java   public class MainClass { public static void main(String[] arg) { String[] arrayOfString = { "Hello", "people", "hello", "world!" };   for (String s : arrayOfString) System.out.println(s);   } }

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Foreach loop cycle in Java Android example