Ask a Question | Answer a Question! |
![](/img/l.gif)
Submitting your question...
ResFinder - Thousands of Practice Papers
what kind of comments should we write in a program? |
![](//pl.respaper.com/64/ashutosh_dash.jpg) |
asked by Ashutosh Dash (ashutosh_dash) 6 years ago |
2 |
+ 1 more questions by ashutosh_dash
while writing a program. should comments even be provided with lines involving declaration and initialization or should it be only based on the program logic? |
![](//pl.respaper.com/64/ashutosh_dash.jpg) |
asked by Ashutosh Dash (ashutosh_dash) 6 years ago |
1 |
|
java keyword which is
----- used to finish the execution of a method
------is used to implement the concept of inheritance |
![](//pl.respaper.com/64/manvimertia.jpg) |
asked by Someone (manvimertia) 6 years ago |
2 |
Return type of Math.max() and Math.min() functions???????????? AASAP!!!!!!!!!!!!! |
![](//pl.respaper.com/64/aayushjoshi.jpg) |
asked by Aayush Joshi (aayushjoshi) 6 years ago |
2 |
+ 1 more questions by aayushjoshi
/*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. |
![](//pl.respaper.com/64/aayushjoshi.jpg) |
asked by Aayush Joshi (aayushjoshi) 6 years ago |
0 |
|
Math.pow(10,2)= 100.0
Math.pow(5,2)= 25.0
Math.pow(25,0.5)= 5.0
Math.sqrt(9)= 3.0
Math.sqrt(25)= 5.0
Math.sqrt(-25)= NaN
Math.round(5.4)= 5
Math.round(5.5)= 6
Math.round(5.0)= 5
Math.round(5.6)= 6
Math.round(-5.6)= -6
Math.round(-5.4)= -5
Math.round(-5.5)= -5
Math.rint(3.3)= 3.0
Math.rint(3.9)= 4.0
Math.rint(2.5)= 2.0
Math.rint(-4.6)= -5.0
Math.rint(-4.5)= -4.0
Math.rint(-4.4)= -4.0 |
![](//pl.respaper.com/64/arya9591.jpg) |
asked by Atharva45 (arya9591) 6 years ago |
2 |
+ 1 more questions by arya9591
Guys what is friendly? |
![](//pl.respaper.com/64/arya9591.jpg) |
asked by Atharva45 (arya9591) 6 years ago |
2 |
|
Can anyone provide a simple code for binary equivalent. |
![](//pl.respaper.com/64/anonymoususer.jpg) |
asked by Anushka K (anonymoususer) 6 years ago |
2 |
Please give the exact definition of -
1.Polymorphism
2.Package
APC book preferred. |
![](//pl.respaper.com/64/harsh104.jpg) |
asked by Harsh Nawal (harsh104) 6 years ago |
2 |
All the Best guys! I know most of you like this subject and want to score a century but please don't be overconfident. Make your presentation in the paper as good as possible and I sincerely hope you guys reach your personal goals.
- Rahul Bhardwaj, your ResMitr |
![](//pl.respaper.com/64/rahulbhardwaj2002.jpg) |
asked by RaBh (rahulbhardwaj2002) 6 years ago |
2 |
Definition of access modifiers and access specifiers |
![](//pl.respaper.com/64/rak_1234.jpg) |
asked by Light yagami (rak_1234) 6 years ago |
1 |
All the best to everyone guys
We all will rip through the paper (as saksham said)
πππβΊοΈβοΈππ€ |
![](//pl.respaper.com/64/phoenix80.jpg) |
asked by Mokshil Shah (phoenix80) 6 years ago |
1 |