• (2 Pages)
  • +
  • 1
  • 2

Basic Java for N00blets pt.2: Important Classes Intro to Scanner, String, Math, DecimalFormat, & Random Rate Topic: ***** 3 Votes

#16 Whales19  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-October 15

Posted 29 October 2015 - 03:16 PM

Please if i may ask, when i add the Scanner scn and it's statements and method, please how do i add the panel for it like giving it a display and making it receive and give out info?
Was This Post Helpful? 0
  • +
  • -

#17 andrewsw  Icon User is online

  • But the opposite, you said.
  • member icon

Reputation: 5531
  • View blog
  • Posts: 21,817
  • Joined: 12-December 12

Posted 29 October 2015 - 04:02 PM

That's an odd question. When you run your application the console appears.. which the Scanner uses to read values and print output.

Are you asking how to run an application? In which case you could start with part I of this tutorial, or a book.

This post has been edited by andrewsw: 29 October 2015 - 04:03 PM

Was This Post Helpful? 0
  • +
  • -

#18 Whales19  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-October 15

Posted 29 October 2015 - 04:14 PM

that's my class and the output is not what i expect but am sure am missing something
i want my output to be in a frame or such panel to display my expression down there.

 import java.util.Scanner;
public class Hello {            
    String firstName = "";
    String lastName = "";  
Scanner scn = new Scanner(System.in);
{
System.out.println("Please Enter Your Name (First Name:");

firstName = scn.next();
lastName = scn.next();

System.out.println("Hello" + firstName + "" + lastName);
    }

} 






output <no main classes found>

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#19 andrewsw  Icon User is online

  • But the opposite, you said.
  • member icon

Reputation: 5531
  • View blog
  • Posts: 21,817
  • Joined: 12-December 12

Posted 29 October 2015 - 04:22 PM

Quote

output <no main classes found>

You need a main() method. If you don't know this then you should not be starting with Part 2 of a tutorial. You need to start with the very basics of Java.

Your issues are not related to this tutorial, but to the basics of Java, so if you have more questions start a new topic in the Java forum.

This post has been edited by andrewsw: 29 October 2015 - 04:24 PM

Was This Post Helpful? 0
  • +
  • -

#20 TimHGMoon  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 24
  • View blog
  • Posts: 188
  • Joined: 04-September 14

Posted 04 November 2015 - 01:15 AM

Your url link is messed up at the bottom by the way. :P
Was This Post Helpful? 0
  • +
  • -

#21 Huxx  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 30-November 15

Posted 03 December 2015 - 09:25 AM

Thank you so much for this! Just ending CS1 learning Java, and this is a great reference to look back to when I forget which exact method I need to solve a problem.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2