问答详情
源自:-

service目录下的两个class文件是乱码的,请问要用什么格式打开呢

漱壕   1 ? 0com/imooc/mvcdemo/service/impl/CourseServiceImpl java/lang/Object 'com/imooc/mvcdemo/service/CourseService <init> ()V Code

  LineNumberTable LocalVariableTable this 2Lcom/imooc/mvcdemo/service/impl/CourseServiceImpl; 

getCoursebyId 5(Ljava/lang/Integer;)Lcom/imooc/mvcdemo/model/Course; com/imooc/mvcdemo/model/Course

 

  setCourseId (Ljava/lang/Integer;)V 娣卞叆娴呭嚭Java澶氱嚎绋? setTitle (Ljava/lang/String;)V  resources/imgs/course-img.jpg

  " #  

setImgPath

 % ' & java/lang/Integer ( ) valueOf (I)Ljava/lang/Integer;

  + , setLearningNum

  . / setLevel 1 涓骇

  3 4 setLevelDesc       


提问者:慕容5152808 2019-09-01 18:42

个回答

  • 慕容5152808
    2019-09-01 21:21:15

    package com.imooc.mvcdemo.service.impl;


    import java.util.ArrayList;

    import java.util.List;


    import org.springframework.stereotype.Service;


    import com.imooc.mvcdemo.model.Chapter;

    import com.imooc.mvcdemo.model.Course;

    import com.imooc.mvcdemo.service.CourseService;



    @Service("courseService")

    public class CourseServiceImpl implements CourseService {


    public Course getCoursebyId(Integer courseId) {

    Course course = new Course();

    course.setCourseId(courseId);

    course.setTitle("深入浅出Java多线程");

    course.setImgPath("resources/imgs/course-img.jpg");

    course.setLearningNum(12345);

    course.setLevel(2);

    course.setLevelDesc("中级");

    course.setDuration(7200l);

    course.setDescr("多线程是日常开发中的常用知识,也是难用知识。bala bala...");



    按照教程把前面文件检查一遍,和视频里面一样还有就是编码格式都改为UTF-8即可