Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class comment {
- public static void main(String args[]){
- String[] com = new String[50];
- Scanner scan = new Scanner(System.in);
- int i = 2 ,a=0;
- System.out.println("Enter comment");
- com[i] = scan.nextLine();
- if(com[0].equals("/")){
- if(com[1].equals("/")){
- System.out.println("comment");
- }
- else if (com[1].equals("*")){
- for(i=2;i<=50; i++){
- if(com[1].equals("*") && com[i+1].equals("/") ){
- System.out.println("comment");
- a=1;
- break;
- }
- else{
- continue;}}
- if(a==0){System.out.println("not");}
- }
- else{System.out.println("not");
- }
- }
- else{System.out.println("not");
- }
- }
- }
- if(com[0].equals("/"))
Add Comment
Please, Sign In to add comment