function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chaitanyakuamar Teruchaitanyakuamar Teru 

map declaration

# create a map
chirutha          -     ramcharan
magadheer     -     ramcharan
orange            -     ramcharan
billa                 -     prabhas 
bhahuballi       -     prabhas 
mirchi              -     prabhas 

Data having be like
moviename    -    rating       -       collection 
chirutha          -     3             -       12cr
magadheer     -     4             -       75cr
orange            -     2             -       12cr
billa                 -     3             -       30cr
bhahuballi       -     4             -       1000cr
mirchi              -     4             -       50cr
how can we declare above data in MAP(collection)
ravi soniravi soni
hi chaitanyakuamar, 
try this following apex class.
public class DummyMapCollection {
    public static void mapCollection(){
        Map<string,MovieInfoWrapper> MapMovieInfoWrapper = new  Map<string,MovieInfoWrapper>();
        
        MovieInfoWrapper oMovieInfoWrapper1 = new MovieInfoWrapper('chirutha',3,'12Cr');
        MovieInfoWrapper oMovieInfoWrapper2 = new MovieInfoWrapper('magadheer',4,'75Cr');
        MovieInfoWrapper oMovieInfoWrapper3 = new MovieInfoWrapper('orange',2,'12Cr');
        MovieInfoWrapper oMovieInfoWrapper4 = new MovieInfoWrapper('billa',3,'30Cr');
        MovieInfoWrapper oMovieInfoWrapper5 = new MovieInfoWrapper('bhahuballi',4,'100Cr');
        MovieInfoWrapper oMovieInfoWrapper6 = new MovieInfoWrapper('mirchi',4,'50Cr');
        
        MapMovieInfoWrapper.put('chirutha',oMovieInfoWrapper1);
        MapMovieInfoWrapper.put('magadheer',oMovieInfoWrapper2);
        MapMovieInfoWrapper.put('orange',oMovieInfoWrapper3);
        MapMovieInfoWrapper.put('billa',oMovieInfoWrapper4);
        MapMovieInfoWrapper.put('bhahuballi',oMovieInfoWrapper5);
        MapMovieInfoWrapper.put('mirchi',oMovieInfoWrapper6);
        system.debug('MapMovieInfoWrapper=====> ' + MapMovieInfoWrapper);
         
    }
    public class MovieInfoWrapper{
        Public String MovieName{get;set;}
        Public decimal Rating{get;set;}
        Public String Collection{get;set;}
        
        public MovieInfoWrapper(string MovieName, decimal Rating, string Collection){
            this.MovieName = MovieName;
            this.Rating = Rating;
            this.Collection = Collection;
            
            
        }
        
    }

}
I hope, it's helps you.
Let me know and close your query to marking  it as solved. so that it can help to others in future.
Thank You