The Java compiler gets upset when it sees the word "class" and gets busy trying to do something with it. So we generally try to avoid using it. When I tried to compile your Class1 the compiler told me this:
C:\jexp>javac class1.java
class1.java:1: class, interface, or enum expected
public Class1 {
^
I renamed your class to avoid this.
public class FirstClass {
public static void main (String[] args) {
int nameOne = 57;
String nameFirst = "Claude";
// Send these two values off to our two methods.
// We are in "static" context (the static modifier is
// in the method declaration of this ("main") method so we can
// call the firstMethod directly because it also has
// the static modifier in its method declaration.
firstMethod(nameOne, nameFirst);
// The secondMethod method is not static, ie, its method
// declaration does not include the static modifier. So
// we cannot call it directly. So we use an instance variable
// of the enclosing class.
// Create an instance of FirstClass and save a reference to it
// in a local variable called (most anything!) "firstClass".
FirstClass firstClass = new FirstClass(); // instance of firstClass
// Use this variable, aka reference, to call the non–static
// method secondMethod.
firstClass.secondMethod(nameOne, nameFirst);
// Trying to call secondMethod directly causes a compile
// error:
//secondMethod(nameOne, nameFirst);
}
private static void firstMethod(int n, String s) {
System.out.println("In firstMethod: n = " + n + " s = " + s);
}
private void secondMethod(int n, String s) {
System.out.println("In secondMethod: n = " + n + " s = " + s);
}
}