Ask a Question | Answer a Question! |
![](/img/l.gif)
Submitting your question...
ResFinder - Thousands of Practice Papers
Who all are doing biology? |
![](//pl.respaper.com/64/scoregoodmarks.jpg) |
asked by Jacelyn (scoregoodmarks) 6 years ago |
3 |
Write a program to assign a full path and file name as given below.Using library functions,extract and output the file path,file name and file extension.
Where am I wrong?
import java.util.*;
class Ex
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.println("Enter file name");
String s = "C:\Users\admin\Pictures\flower.jpg";
int m = s.lastIndexOf('.');
System.out.println(" Extension="+(s.substring(m+1));
int j = s.lastIndexOf('\');
System.out.println("Output path ="+s.substring(0,j+1);
System.out.println("File name="+(s.substring(j+1,m));
}
} |
![](//pl.respaper.com/64/monstercat.jpg) |
asked by Abhinav Sharma (monstercat) 6 years ago |
0 |
what is the use of math.rint() please give an example also |
![](//pl.respaper.com/64/hemant83.jpg) |
asked by Hemant Dangi (hemant83) 6 years ago |
1 |
WAP to input a word and remove the consecutive repeated characters by replacing the sequence of repeated characters by its single occurance
Sample Input:Jaaaaaavvvvvvvvaaaaaaaaa
Sample Output:Java
Would this program be accepted?
import java.util.*;
public class Q8
{
static void main()
{
Scanner ob=new Scanner(System.in);
System.out.println("Input String:");
String s=ob.nextLine();
s=s+"*";
int i;int j;
for(i=0;i<s.length()-1;i++)
{
char ch=s.charAt(i);
if(ch==s.charAt(i+1))
continue;
else
System.out.print(s.charAt(i));
}
}
} |
![](//pl.respaper.com/64/siddhant94.jpg) |
asked by Siddhant Joshi (siddhant94) 6 years ago |
3 |
Write the output for the following:
String s="Today is Test" ;
System.out.println(s.indexOf('T'));
System.out.println(s.substring(0,7) + " " +"Holiday");
According to me, the answer should be:Today is Holiday.
But the marking scheme says that it is:Today i Holiday [OR] Today Holiday
Pls explain which is correct, and WHY TF are two answers being accepted? |
![](//pl.respaper.com/64/gar_d02.jpg) |
asked by Gargie D'souza (gar_d02) 6 years ago |
5 |
Can someone give me the order of logical, relational, and arithmetic operators? |
![](//pl.respaper.com/64/throwaway.jpg) |
asked by Pavan K Srinivasan (throwaway) 6 years ago |
1 |
Is function call by reference there in the syllabus? will the icse instruct to write the programmes using only call by reference method? |
![](//pl.respaper.com/64/sameed.jpg) |
asked by Sameed Hussain (sameed) 6 years ago |
1 |
Why is a class known as composite data type? |
![](//pl.respaper.com/64/solution86.jpg) |
asked by Niraj Gupta (solution86) 6 years ago |
3 |