Made some last minute "business" decisions. I am no longer going to try programming in Java. It's a dead end for my ambitions. ... so many changes us youth go through -_-'
This is my basic C++ program. I'm trying to clone it in java.
#include <iostream> using namespace std; int main () { int i; cout << "Your story begins NOW!!!"; cout << endl; cout << "Please enter your age: "; cin >> i; cout << endl; cout << "The value you entered is: " << i; cout << endl; system("PAUSE"); return 0; }
For java so far all I have is
import java.io.*; import java.util.*; public class initiate { public static void main(String[] args) { System.out.println("Your story begins NOW!!!\n"); System.out.println("Enter your age: \n"); Scanner scan = Scanner(System.in); } }
What am I missing? I receive this error
Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method Scanner(InputStream) is undefined for the type initiate at initiate.main(initiate.java:9)