JAVA LAB ASSIGNMENT 6
JAVA LAB ASSIGNMENT 6
import java.util.Scanner;
public class Exercise4 {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Input the string: ");
String str = in.nextLine();
while(n > 0) {
result += n % 10;
n /= 10;
}
return result;
}
class Box
{
double width, height, depth;
Box()
{
width = 1;
height = 1;
depth = 1;
}
void myMethod()
{
System.out.println("Width : " + width);
System.out.println("Height : " + height);
System.out.println("Depth : " + depth);
}
}
}
class Person
{
String name;
Person(String n)
{
name = n;
}