+ 1

any one find my error?

import java.util.*; // Compiler version JDK 11.0.2 class Dcoder { public static void main(String args[]) { int a; System.out.print("enter password:"); Scanner obj=new Scanner(System.in); a=obj.nextInt(); if(a=9) {System.out.println("enter successfull"); } } }

26th Jul 2022, 3:07 AM
Sachin Patel
Sachin Patel - avatar
3 Answers
+ 2
In case of "if" statements there should be relational operators not an assignment operator. specially in java if statement accept only Boolean value or those equation which will give boolean value as a condition. if(a==9) //this is the correct statement....
26th Jul 2022, 3:18 AM
Pallavi Jha
Pallavi Jha - avatar
+ 1
Pallavi Jha #python 2.7.15 letter='''Dear <|name|>,\n your are salected,Date <|date|>''' name=input("enter yor name") date=input("enter dalte") letter=letter.replace("<|name|>",name) letter=letter.replace("<|date|>",date) print(letter)
3rd Aug 2022, 8:34 AM
Sachin Patel
Sachin Patel - avatar
+ 1
letter='''Dear <|name|>, your are salected,Date <|date|>''' name=input("enter yor name \n") date=input("enter dalte \n") letter=letter.replace("<|name|>",name) letter=letter.replace("<|date|>",date) print("\n") print(letter)
3rd Aug 2022, 12:22 PM
Pallavi Jha
Pallavi Jha - avatar