any one plz tell me about the boolean variable in java...
howz it work in computer if its numeric representation is not present , becozz our computer just process 0 & 1 ...
and also how much space are allocated when we initializes a boolean variable........??????
import java.io.File;
import java.util.Scanner;
public class FileExists {
public static void main(String[] s) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the url of a file: ");
System.out.flush();
String filename = scanner.nextLine();
File file = new File(filename);
if(file.exists()){System.out.println("exists");}
else{System.out.println("not exists");}
}
}
output1:
Enter the url of a file: C:\Users\298564\Desktop\sa.txt
exists
output2:
Enter the url of a file: C:\Users\298564\Desktop\asdfs.txt
not exists
javadeep chandra sahu June 7, 2011 at 1:10 PM
all importent topic in java programming
java ( web service)sathiraju July 1, 2011 at 7:56 PM
this is best usefull concept to who is working in java technology. thankyou.
javarashmi rani August 20, 2011 at 1:01 PM
java aii programing(question with ans)
about boolean variable ...manoj nainwal August 26, 2011 at 12:06 AM
any one plz tell me about the boolean variable in java... howz it work in computer if its numeric representation is not present , becozz our computer just process 0 & 1 ... and also how much space are allocated when we initializes a boolean variable........??????
www.yybook.orgä¸?æ?? December 12, 2011 at 2:38 PM
good job
i like this web sitesethuraman March 23, 2012 at 11:33 AM
very useful of this notes
my name is ali babaali baba June 16, 2012 at 1:42 PM
no comments...do you have??? ;-) :D
searching file using javasantosh August 2, 2012 at 12:21 PM
import java.io.File; import java.util.Scanner; public class FileExists { public static void main(String[] s) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the url of a file: "); System.out.flush(); String filename = scanner.nextLine(); File file = new File(filename); if(file.exists()){System.out.println("exists");} else{System.out.println("not exists");} } } output1: Enter the url of a file: C:\Users\298564\Desktop\sa.txt exists output2: Enter the url of a file: C:\Users\298564\Desktop\asdfs.txt not exists
miracle ma :Dnavinaar September 5, 2012 at 7:44 PM
wow;)
getting a inputRAM33 October 1, 2012 at 12:12 PM
what are different ways in java to get inputs and the most simplest way?
java.io packageRajyalaxmi December 3, 2012 at 3:20 PM
We have Scanner class in io then what is the need of Console class?
Post your Comment