Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Running Java Code Errors: Console Output Result Termination

Running Java Code Errors: Console Output Result Termination

Scheduled Pinned Locked Moved Java
helpjavalearning
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11064514
    wrote on last edited by
    #1

    Hello there fellow java users, I'm dealing with some situations with Java Eclipse, I was writing the codes for a public class related to 'books". basically using instance data for the author, publisher, copy right date, etc. I feel like I've got all the correct codes and everything but I feel as if I've stumbled onto a certain error that I can't fix. Every-time I try to run the program the console output says: book[Java Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe. I don't know what I did wrong, if anybody can help me that would be great. Here are the codes i wrote:

    package book;
    public class book {
    public static void main(String[] args){

    }
            private String title;
            private String author;
            private String publisher;
            private int copyRightDate;
    
    
            public book(String authorName, String publisher, String author, String year22) {
    
    
                title = getTitle();
                author = getAuthor();
                publisher = getPublisher();
                copyRightDate = year2();
                }
                private int year2() {
                return 0;
            }
                public book(String authorName, String publisher2, String author2,
                    int year32) {
            }
                public book()
            {
                author = "Ridley Pearson";
    
                title = "Kingdom Keepers";
                publisher = "Disney";
    
            }
            public void setAuthor(String authorName) {
                author = authorName; }
                    public String getAuthor() {
    
                return author; }
    
             public void setTitle(String bookTitle) {
                title = bookTitle; }
    
            public String getTitle() {
                return title; }
    
            public void setPublisher(String publisherName) {
                publisher = publisherName; }
            public String getPublisher() {
                return publisher;}
            public void setCopyRightDate(int date) {
    
                copyRightDate = date; }
    
            public int getCopyRightDate() {
                return copyRightDate; }
    
            public String toString() {
               return (title + "\\t" + author + "\\t" + publisher + "\\t" + copyRightDate);}
    

    public class bookshelf{
    }
    public void main1(String[] args) {

    L U 2 Replies Last reply
    0
    • U User 11064514

      Hello there fellow java users, I'm dealing with some situations with Java Eclipse, I was writing the codes for a public class related to 'books". basically using instance data for the author, publisher, copy right date, etc. I feel like I've got all the correct codes and everything but I feel as if I've stumbled onto a certain error that I can't fix. Every-time I try to run the program the console output says: book[Java Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe. I don't know what I did wrong, if anybody can help me that would be great. Here are the codes i wrote:

      package book;
      public class book {
      public static void main(String[] args){

      }
              private String title;
              private String author;
              private String publisher;
              private int copyRightDate;
      
      
              public book(String authorName, String publisher, String author, String year22) {
      
      
                  title = getTitle();
                  author = getAuthor();
                  publisher = getPublisher();
                  copyRightDate = year2();
                  }
                  private int year2() {
                  return 0;
              }
                  public book(String authorName, String publisher2, String author2,
                      int year32) {
              }
                  public book()
              {
                  author = "Ridley Pearson";
      
                  title = "Kingdom Keepers";
                  publisher = "Disney";
      
              }
              public void setAuthor(String authorName) {
                  author = authorName; }
                      public String getAuthor() {
      
                  return author; }
      
               public void setTitle(String bookTitle) {
                  title = bookTitle; }
      
              public String getTitle() {
                  return title; }
      
              public void setPublisher(String publisherName) {
                  publisher = publisherName; }
              public String getPublisher() {
                  return publisher;}
              public void setCopyRightDate(int date) {
      
                  copyRightDate = date; }
      
              public int getCopyRightDate() {
                  return copyRightDate; }
      
              public String toString() {
                 return (title + "\\t" + author + "\\t" + publisher + "\\t" + copyRightDate);}
      

      public class bookshelf{
      }
      public void main1(String[] args) {

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your main method has no body, so it never does anything.

      M 1 Reply Last reply
      0
      • L Lost User

        Your main method has no body, so it never does anything.

        M Offline
        M Offline
        Member 11111606
        wrote on last edited by
        #3

        so what is he supposed to do???

        L 1 Reply Last reply
        0
        • M Member 11111606

          so what is he supposed to do???

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Are you being serious?

          1 Reply Last reply
          0
          • U User 11064514

            Hello there fellow java users, I'm dealing with some situations with Java Eclipse, I was writing the codes for a public class related to 'books". basically using instance data for the author, publisher, copy right date, etc. I feel like I've got all the correct codes and everything but I feel as if I've stumbled onto a certain error that I can't fix. Every-time I try to run the program the console output says: book[Java Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe. I don't know what I did wrong, if anybody can help me that would be great. Here are the codes i wrote:

            package book;
            public class book {
            public static void main(String[] args){

            }
                    private String title;
                    private String author;
                    private String publisher;
                    private int copyRightDate;
            
            
                    public book(String authorName, String publisher, String author, String year22) {
            
            
                        title = getTitle();
                        author = getAuthor();
                        publisher = getPublisher();
                        copyRightDate = year2();
                        }
                        private int year2() {
                        return 0;
                    }
                        public book(String authorName, String publisher2, String author2,
                            int year32) {
                    }
                        public book()
                    {
                        author = "Ridley Pearson";
            
                        title = "Kingdom Keepers";
                        publisher = "Disney";
            
                    }
                    public void setAuthor(String authorName) {
                        author = authorName; }
                            public String getAuthor() {
            
                        return author; }
            
                     public void setTitle(String bookTitle) {
                        title = bookTitle; }
            
                    public String getTitle() {
                        return title; }
            
                    public void setPublisher(String publisherName) {
                        publisher = publisherName; }
                    public String getPublisher() {
                        return publisher;}
                    public void setCopyRightDate(int date) {
            
                        copyRightDate = date; }
            
                    public int getCopyRightDate() {
                        return copyRightDate; }
            
                    public String toString() {
                       return (title + "\\t" + author + "\\t" + publisher + "\\t" + copyRightDate);}
            

            public class bookshelf{
            }
            public void main1(String[] args) {

            U Offline
            U Offline
            User 11120519
            wrote on last edited by
            #5

            {
            new book ("Kingdom Keepers III\n", "Disney In Shadow\n", "Ridley Pearson\n", year2);
            new book("Kingdom Keepers IV\n", "Power Play\n", "Ridley Pearson\n", year3);
            System.out.println("Kingdom Keepers III");
            System.out.println("Kingdom Keepers IV");
            }

            at first ,static-method can't transfer construct-method;the virtual can't recognize them for transfering each other,and static's prior higher than construct at second , if u want to test main ,and write printout static and construct ; u main-method should new book,through print result,u can find their prior

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups