I will call readInput() for the two different objects. But in the first i want to get output as "for the first line" , in the second i want to get output as "for the second line". How can i do? Thanks .
import java.util.*;
public class Nokta{
Scanner keyboard = new Scanner(System.in);
public void readInput()
{
System.out.println("for the first line ");
String degerler = keyboard.nextLine();
}
I will call like this:
Nokta dogru1 = new Nokta ();
dogru1.readInput();
Nokta dogru2 = new Nokta ();
dogru2.readInput();