Home > Back-end >  Just learning Java don't know how to modify, a great god for help
Just learning Java don't know how to modify, a great god for help

Time:03-22

The class Trainee
{
Int the Name;
int weight;
Int height;

Void height () {
Int height=180;
System. The out. Println (height);
}

Void weight () {
Int weight=170;
System. The out. Println (weight);
}
}


The class demoTrainee
{
Public static void main (String args []);
Trainee me=new Trainee ();
Me. Weight ();
}

CodePudding user response:

Class demoTrainee class is behind the main function of the curly braces, not a semicolon

CodePudding user response:

 package com. Yiweikeji. Cif. Util. 

The class Trainee
{
Int the Name;
int weight;
Int height;

Void height () {
Int height=180;
System. The out. Println (height);
}

Void weight () {
Int weight=170;
System. The out. Println (weight);
}

Public static void main (String args []) {
Trainee me=new Trainee ();
Me. Weight ();
}}
  • Related