Wednesday, December 31, 2014

Java Tutorial For Beginners 24 - The final keyword in Java













1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
package lesson1;
/*
Final keyword has a numerous way to use:

A final class cannot be subclassed.
A final method cannot be overridden by subclasses
A final variable can only be initialized once
*/
public class Hello {
   public final int number ;
   
   Hello () {
    number = 10;
   }
   
}














java final class

java public final class

java final method

java final object

java final modifier

java final variable in method

java using final

private static final

Writing Final Classes and Methods

What is final in Java? Final variable , Method and Class

java - Why declare final variables inside methods

Java Final Keyword

final (Java)

Java Tutorial For Beginners 23 - Public, Private, Protected and this (Ja...











1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package lesson1;
/*Access Levels
Modifier Class Package Subclass World
public          Y      Y  Y           Y
protected   Y     Y         Y               N
no modifier   Y      Y   N           N
private           Y  N   N           N
*/
public class Student {
 private String name;
 private int age;
 
 public String getName() {
  return name;
 }
 public void setName(String name) {
  this.name = name;
 }
 public int getAge() {
  return age;
 }
 public void setAge(int age) {
  this.age = age;
 }

}



public class MyClass {

 public static void main(String[] args) {
  Student stu = new Student();
  stu.setName("mark");
  System.out.println(stu.getName());
 }
    
}












package protected java

java package visibility

java protected visibility

java class visibility

java default public private

java method visibility

java default protected

java protected vs default

java access modifiers example

java access modifiers inheritance

java non access modifiers

java final

java access modifiers for class

java access modifiers matrix

java access modifiers package-private

java access modifiers


Tuesday, December 30, 2014

Java Tutorial For Beginners 20 - Method Overloading in Java











1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
package lesson1;
public class MyClass {

 public static void main(String[] args) {
       System.out.println(Add(1,36));
       System.out.println(Add(5.656,40.66));
       System.out.println(Add("hello"," world"));
 }
    
 public static int Add (int a ,int b){
  return (a+b);
 }
 
 public static double Add (double a ,double b){
  return (a+b);
 }
 
 public static String Add (String a ,String b){
  return (a+b);
 }
}








Searches related to Classes and Objects in java

classes and objects in java pdf

classes and objects in java ppt

classes and objects in c++

classes in java

classes and objects in java with realtime examples

methods in java

encapsulation in java

define class in java


Java Tutorial For Beginners 18 - Classes and Objects in Java













1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package lesson1;

public class Student {
 int id;
 String name;
 int age;

 public int getId() {
  return id;
 }
 public void setId(int id) {
  this.id = id;
 }
 public String getName() {
  return name;
 }
 public void setName(String name) {
  this.name = name;
 }
 public int getAge() {
  return age;
 }
 public void setAge(int age) {
  this.age = age;
 }
}

public class MyClass {

 public static void main(String[] args) {
  Student mark = new Student();//mark -> object or instance
  
  mark.setId(1);
  mark.setName("Mark");
  mark.setAge(15);
  
  Student tom = new Student();//Tom -> object or instance
  
  tom.setId(1);
  tom.setName("Tom"); 
  tom.setAge(14);
  
  System.out.println(mark.getName() + " is "+ mark.getAge() + " years old");
  System.out.println(tom.getName() + " is "+ tom.getAge() + " years old");
 }

}












Searches related to Classes and Objects in java

classes and objects in java pdf

classes and objects in java ppt

classes and objects in c++

classes in java

classes and objects in java with realtime examples

methods in java

encapsulation in java

define class in java

Java Tutorial For Beginners 17 - Parameter passing and Returning a Value...













1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  
  int sum = Add(100,201,211);
  int result =sum * 15;
  System.out.println(result);
 }
 
 public static void sayHello(String name) {
  System.out.println("Hello " + name);
 }
 
 public static int Add (int a,int b,int c)
 {
  //System.out.println(a+ b +c);
  return (a +b+c);
 }

}














java method arguments ellipsis

java method arguments vs parameters

java method arguments pass by reference

java method arguments list

java method arguments final

java method argument annotation

java method argument array

java method argument three dots

Monday, December 29, 2014

Java Tutorial For Beginners 15 - Java String











1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
package lesson1;
public class MyClass {

 public static void main(String[] args) {
      String myString = "Hello e World e";
      int myStringLegth = myString.length();
      String myStringinCase = myString.toUpperCase();
      
      System.out.println(myString.indexOf('o'));
 }

}





Java Tutorial For Beginners 14 - The for Statement in Java (for loops)















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  int[] myintarray = {100,31,26,48,52};
  
  for (int index=0 ; index < 5 ; index++)
  {
   System.out.println(myintarray[index]);
  }
  
  for (int element : myintarray)
  {
   System.out.println(element);
  }
 }

}










Searches related to array java

arraylist java

string array java

array class java

multidimensional array java

array length java

dynamic array java

2d array java

print array java

Java Tutorial For Beginners 13 - Arrays in Java











1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  int[] myintarray = {100,31,26,48,52};
  /*
  int[] myIntArray = new int[3];
  int[] myIntArray = {1,2,3};
  int[] myIntArray = new int[]{1,2,3};
  */
  int index=0;
  while(index < 5) {
  System.out.println(myintarray[index]);
  index++;
  }
 }

}








Searches related to array java

arraylist java

string array java

array class java

multidimensional array java

array length java

dynamic array java

2d array java

print array java

Java Tutorial For Beginners 13 - Arrays in Java















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  int[] myintarray = {100,31,26,48,52};
  /*
  int[] myIntArray = new int[3];
  int[] myIntArray = {1,2,3};
  int[] myIntArray = new int[]{1,2,3};
  */
  int index=0;
  while(index < 5) {
  System.out.println(myintarray[index]);
  index++;
  }
 }

}








Searches related to array java

arraylist java

string array java

array class java

multidimensional array java

array length java

dynamic array java

2d array java

print array java

Java Tutorial For Beginners 12 - The do-while Statements (do-while Loops)











1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package lesson1;
public class MyClass {

 public static void main(String[] args) {
  int a = 0;

  while (a <= -1)
  {
   System.out.println(a); 
   a++;
  }

  System.out.println("------------------------------");
  int b = 0;
  do {
   System.out.println(b); 
   b++;
  } while (b <= -1);


 }

}












How to Use a do...while Statement in Java

Searches related to do while java

Do While Loop | Java Examples

 do while Loops - YouTube

do while java string

do while java exercise

do while java

java do while example

do while javascript

for loop java

switch case java

do until java

Looping - Do While
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ