Ask a Question | Answer a Question! |
Submitting your question...
ResFinder - Thousands of Practice Papers
Definition of access modifiers and access specifiers |
|
asked by Light yagami (rak_1234) 6 years ago |
1 |
/*I don't know why but there is a problem with this code.When I'm entering a number for the value of 'n',and press enter after pressing it, instead of appearing one by one, two input lines appear at once,like:
Enter name 1:
Enter name 2: (Both together,and only one value they accept).
Then, it works properly. I'm forwarding the code, anyone who can help, will be appreciated.*/
import java.util.*;
class BubSortNames
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int i,j,n;
String names[]=new String[100];
String swap="";
System.out.println("Enter the value of 'n':");
n=sc.nextInt();
System.out.println();
for(i=0;i<n;i++)
{
System.out.println("Enter name "+(i+1)+":");
names[i]=new String(sc.nextLine());
}
//Sorting steps.
for(i=0;i<n-1;i++)
{
for(j=0;j<n-1-i;j++)
{
if(names[j].compareTo(names[j+1])>0)
{
swap=names[j];
names[j]=names[j+1];
names[j+1]=swap;
}
}
}
//Displaying the sorted list.
for(i=0;i<n;i++)
System.out.println(names[i]);
}//MAIN.
}//CLASS. |
|
asked by Aayush Joshi (aayushjoshi) 6 years ago |
0 |
+ 2 more questions by aayushjoshi
int p[]={10,20,22,24,32,44};
p[0]++;
System.out.println(p[0]+p[2]%p[3]==p[4]?p[4]/2:p[4]/3);
Give the output. |
|
asked by Aayush Joshi (aayushjoshi) 6 years ago |
1 |
System.out.println("1234".compareTo("1234.0")) Give output. |
|
asked by Aayush Joshi (aayushjoshi) 6 years ago |
2 |
All the best to everyone guys
We all will rip through the paper (as saksham said)
πππβΊοΈβοΈππ€ |
|
asked by Mokshil Shah (phoenix80) 6 years ago |
1 |
BYE I AM GOING TO SLEEP IN MY DREAMS
make the computer examination best
its do or die either comp or 100
seize your glory
and pls dont forget to write this at the end of ur paper
if(computer_marks==100)
System.out.println("Thank u");
else
System.out.println(null); |
|
asked by Rtstud (mdarfath) 6 years ago |
2 | + 4 more questions by mdarfath
does anyone know SQL HERE
CAN SOME1 GIVE RESON FOR THE DIFF OP GIVEN BY THIS CODE
System.out.println(Math.pow(3,1/2));
System.out.println(Math.pow(3,1.0/2.0)); |
|
asked by Rtstud (mdarfath) 6 years ago |
5 |
does anyone know SQL HERE |
|
asked by Rtstud (mdarfath) 6 years ago |
1 |
char a1 ='2' +'2';
System.out.println(a1);
and
char a1 ='2' +2;
System.out.println(a1);
check this codes out int Bj its sneaky |
|
asked by Rtstud (mdarfath) 6 years ago |
3 |
by the who wishes to be hacker here
I aspire to be a Hacker(penetrationtester) |
|
asked by Rtstud (mdarfath) 6 years ago |
0 |
all the best guys!!!! let's score a century in tomorrow's paper........ |
|
asked by Mathomania (sankua) 6 years ago |
2 |
If the question asks for POSITION of a character, do we give index or index +1.
In 2011 such a question had come and in 10 years book index is given |
|
asked by Rohan Gupta (rohang37) 6 years ago |
2 |
What happens when there is a semicolon after a for or while loop? |
|
asked by Momo (zenab13) 6 years ago |
4 |
Output of
Math.rint(3.5)
Math.round(3.5) |
|
asked by Ansh Singh (anshkush) 6 years ago |
2 |
int i = 1;
while(I++<=1)
{
i++;
System.out.print(i+ " ");
}
System.out.print(i);
Output is : 3 4 (I saw it in answers)
Please show the working...... |
|
asked by J (jatin_01) 6 years ago |
4 |
After writing a function overloading program, is it necessary to call the function??? |
|
asked by Uttam Soren (uttamsoren1735) 6 years ago |
3 |
| |