Code: class ForEach { public static void main( String args[] ) { int a[]={1,1,2,3,4,5,5}; for(int i: a ) { System....
Read More
Showing posts with label Basic of Java. Show all posts
Showing posts with label Basic of Java. Show all posts
24 How to create Object using clone() method in java?
Clone: Cloning means creating new object with the existing object state is called as cloning. Simple Program to understand why cloning ...
Read More
23 How to create object using Literals (Auto Boxing ) in Java ?
AutoBoxing.java class AutoBoxing { public static void main( String args[] ) { int i = 100; Integer j = 100; // Auto Boxing ...
Read More
22 How to create object using Pre Define Factory Method in Java ?
Static Pre Define Factory Method In this I created one class "SBToS" and in this we have two non-static pre defined factory met...
Read More
21 How to create object using User Define Factory Method in Java ?
In this I created one class "FMDemo" in that creating object of classes "Employee" and "ITCompany". But the ...
Read More
20 How to create object using De-serialization Concept in Java?
In this first I am serializing the student data into the file "des" and after that de-serializing the same data into an object an...
Read More
19 How to load data dynamically from keyword using java.io.Console in Java?
For Ex: In this I am reading string data and password data and save password into the file "test.text". ConsoleDemo .java i...
Read More
20 How to load data dynamically from keyword using java.io.DataInputStream in Java?
For Ex: In this I am reading string and int data from the keyboard. DISDemo .java import java.io.DataInputStream; import java.io.IOE...
Read More
21 How to load data dynamically from file using java.io.DataInputStream in Java?
For Ex: In this I am reading one Boolean , Char, Int and String data from the file. DISDemo .java import java.io.DataOutputStream; im...
Read More
Subscribe to:
Posts (Atom)