0
Getting error as " identifier expected"
import.java.util.scanner; class areaofradius { public static void main (String args[]){ double ra,Areaofradius; Scanner sc=new Scanner (System.in); ra=nextDouble(); Areaofradius=3.14*ra*ra; } }
6 odpowiedzi
+ 1
first line
import java.util.Scanner;
and
Ra=sc.nextDouble();
+ 1
I am also facing same kind of trouble, I hope I can find solution to same error,
for following code.
import java.util.Scanner;
class userinput
{
public static void main(string args[])
{
Scanner input = new Scanner(system.in);
system.out.print("Dont be Furious just a single digit: ");
int number = input(system.in);
system.out.println("lets Assume You have suceeded in retriving " +number );
}
}
0
I'm very much beginner to Java. I want to make a list containing strings and integers. Using If statement, want to delete an element in the list which is greater than 30 and print the new list. Can anybody please correct my code.
public class IfStatement{
public class Delete{
public static void main (String [] args){
String Names={"Shraddha","Manjunath"};
int ages={23,35};
if (ages>30){
del ages;
}
}
System.out.println(Names);
}
}
0
import java.util.*;
// Compiler version JDK 11.0.2
class Dcoder
{
public static void main(String args[])
{
Scanner SC =new (System.in);
int principle = sc.nextInt();
float rate = sc.nextFloat();
int time =sc.nextInt();
float simpleInterest= principle*rate*time/100;
System.out.println("the simple interest is"+simpleInterest) ;
}
}
0
import java.util.*;
// Compiler version JDK 11.0.2
class Dcoder
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int r = sc.nextInt();
int a[][] = new int[n][r];
for(int i = 0 ; i>n ; i++){
for(int j = 0 ; j>r ; j++){
a[i][j] = sc.nextInt();
}
}
for(int i = n-1 ; i>=0 ; i--){
for(int j = r-1 ; j>=0 ; j--){
System.out.println(a[i][j]);
}
}
}
}
0
how to reverse a array.