Java Interview Quiz -Part 4
Java Interview Quiz -Part 3
Java Interview Quiz -Part 2
Java Interview Quiz -Part 1
Java File Permissions example
To set the read permissions to a file from java code use setReadable method of File class to true or false.
To set the write permissions to a file from java code use setWritable method of File class to true or false. Continue reading
File.separator is used to obtain the local computer’s proper separator character instead of explicitly using / or \. For example On a Windows computer, the separator character is a backslash (\).
On a Linux or Mac OS X system, it’s a forward slash (/).
File.separator is a String consisting of one character—the proper separator for the system. Continue reading
Write a java program to create new file in java?
File is created using java.io.File class.File Object contains information about file but it doesnot create new file.
The below line creates a new file object but it does not create a file in C drive.
File file=new File(“c:\\File1.txt”); Continue reading
String coding interview questions in java
1) Write a java program to reverse string in java without using reverse() method of string api?
2) Write a program to check if a string is palindrome or not?
3) Write a program to count number of occurrences of characters in String in java?
4) How to split strings in java?
5) How to convert string to date in java?
6) How to convert String to int in java? Continue reading
Top 20 string interview questions in java
Here are the list of string string interview questions and answers asked by many interviewers.In coming articles we will discuss each question below in detail?
1) Is String a datatype in java?
2) Explain different ways to create Strings in java? Continue reading