Professional Documents
Culture Documents
Sample Java Internal Answers
Sample Java Internal Answers
in Java.
2) Check whether entered string is having the length less than 21 and
at least one special character, $ or #.
package mystrings;
class User{
String uid;
String pwd;
u1.signUp("kishor.mahi@gmail.com", "king$123");
u1.logIn("kishor.mahi@gmail.com", "king$123");
u1.changePwd("scet_$ece");
u1.logIn("kishor.mahi@gmail.com", "king$123");
u1.logIn("kishor.mahi@gmail.com", "scet_$ece");
}
3. Display register number, Name and Percentage of marks by accepting
the student’s comma delimited record.
Input Record format:
RegisterNumber,Name,Department,Marks1,Marks2,Marks3
import java.io.*;
import java.util.Scanner;
class GFG {
System.out.println("Name "+Name);
System.out.println("Department "+Department);
System.out.println("Marks1 "+Marks1);
System.out.println("Marks2 "+Marks2);
System.out.println("Marks3 "+Marks3);
if (isPalindrome(str))
System.out.print("Yes");
else
System.out.print("No");
}
}
class Animal{
String color="white";
String color="black";
void printColor(){
System.out.println(color);//prints color of Dog class
class TestSuper1{
d.printColor();
}}